Hi!
When a client invoke loginIn() ,the client throw a remoteException.
java.rmi.UnmarshalException:error unmarshalling return;nested exception is:
java.io.WriteAbortedException:writing aborted;
java.io.NotSerialzableException
erson
I defined a Person class.
the code of loginIn() in the Server:
public Vector loginIn(int qno) throws Exception {
String sql1,sql2;
Vector customers=new Vector();
sql1="select * from relation_table where Customer1="+qno;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
Connection con=null;
String url="jdbc
dbc:JICQ";
con=DriverManager.getConnection(url,"","");
Statement s1=con.createStatement (ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
Statement s2=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
ResultSet rs1=s1.executeQuery(sql1);
rs1.last();
int count=rs1.getRow();
if(count==0){
System.out.println("Null!");
}
else{
rs1.first() ;
for(int i=0;i<count;i++){
int No=rs1.getInt("Customer2");
sql2="select * from login_table where qno="+No;
ResultSet rs2=s2.executeQuery(sql2);
if(!rs2.next()){
System.out.println("Some Exceptions!");
}
else{
String nick=rs2.getString("Nickname");
Person p=new Person(No,nick);
customers.addElement(p);
}
if((i+1)==count) {
break;
}
rs1.next();
}
}
return customers;
}
Thanx!