• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I debug My-Error ? ^^

 
SungChan Park
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Class DataClientGUI.java
================================================================
package suncertify.client;
...
public class DataClientGUI extends JFrame {
String mode;
Server server;
...
public DataClientGUI() {

super();

DataAccessFactory daf =new DataAccessFactory();

server = daf.getConnectionChoice(mode);
}
...
================================================================
&
Class DataAccessFactory.java
================================================================
package suncertify.client;
...
public class DataAccessFactory {
...
public Server getConnectionChoice(String mode) throws IOException{
// test if local is wanted
if(mode.equals("local")){
server = new LocalServerImpl(dbname);
// test if remote is wanted
} else if (mode.equals("remote")){

try {
server = (RemoteServerImpl)Naming.lookup("rmi://localhost:1099/server");
} catch (Exception e) {}

// otherwise null
}else
server = null;
return server;

}

}
================================================================
F:\job\Assignment\scjd\src>javac suncertify\client\*.java
suncertify\client\DataClientGUI.java:57: Exception java.io.IOException must be c
aught, or it must be declared in the throws clause of this constructor.
server = daf.getConnectionChoice(mode);
^
1 error
================================================================
Can anyone help me ?
 
herve attia
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public DataClientGUI() {

super();

DataAccessFactory daf =new DataAccessFactory();

try {
server = daf.getConnectionChoice(mode);
}catch (IOException e) {}

}
}

Read about Java exception !!
 
SungChan Park
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, herve attia !!
I could managed to solve it with your help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic