dcsimg
Get object other than string from RMI server
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Thor_Boyd
Posted On:   Sunday, July 21, 2002 08:52 AM

I wrote a RMI server and client program.Then i found out that R MI server is unable to return resultset retrieve from database.I think that maybe object serialization can help,but don't know how...Please teach me how to do it...

Thanks

Re: Get object other than string from RMI server

Posted By:   Gautam_Marwaha  
Posted On:   Sunday, July 21, 2002 11:06 PM

You are right. RMI will not work for anything which is not serializable. Conside the following options:

1. Write a bean/value object class (which implements seralizable) that can store all the data available with one record. Iterate thru the resultset, populate the value object, put the value object in collection. When done return the collection back to the client

2. Specifically for resultsets - use JDBC Rowset API (http://developer.java.sun.com/developer/earlyAccess/crs) with which you can convert your resultset into a CachedRowset (which is serializable) and return it to client.

About | Sitemap | Contact