I Have a server that access a database via JDBC, and want to return ResultSets VIA RMI back to the Client. I have read that this can't be done (But it can be got you could go through your ResultSet and Return a Vector). I would be grateful if somebody could give me an example of this. Better yet if there is some way of passing the ResultSet Back. I tried making the ResultSet serializable but that didn't work.
Answer
Look, as far as I understand it, a resultset really doesn't make ANY sense once serialized out of the JVM it was created in.
Connection con;
Statement st;
ResultSet rs = st.executeQuery("query here");
Vector v = new Vector();
while(rs.next) {
v.add(rs.getXXXXX);
}
then close your resultset and serialize the vector.