• Post Reply Bookmark Topic Watch Topic
  • New Topic

returning a resultset in rmi  RSS feed

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am getting a exception
the o/p is

java.rmi.UnmarshalException:error unmarshalling return;
nested exception is java.io.WriteAbortedException: Writing aborted by exception ;java.io.NotSerializableException :
sun.jdbc.odbc.JdbcOdbcResultSet

what i am trying to do is get a sql query from the client program execute the query in the server pgm and then return the
resultset from the server to the client and then display the results in the client program but when i run the client program i get this exception.
 
paul wheaton
Trailboss
Posts: 22553
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like the JdbcOdbcResultSet object cannot be sent over an RMI connection.
 
Ian Whitelaw
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've come across this problem too. A ResultSet cannot be sent over a network because it isn't serializable. One way round this is to put the results of your query into a Collection (which is serializable). Don't know if this is the optimal solution. Anyone got any other ideas?
 
Ian Whitelaw
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just noticed a thread in the Servlets forum on this subject. Have a look at the topic entitled 'Passing a ResultSet from servlet to applet.'
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!