This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes passing resulset object to client in rmi Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Distributed Java
Reply Bookmark "passing resulset object to client in rmi" Watch "passing resulset object to client in rmi" New topic
Author

passing resulset object to client in rmi

Saurabh nitrr
Greenhorn

Joined: Jan 30, 2011
Posts: 5
hi'
how tow to pass a ResultSet object from server to client in rmi.
when i am simply passing the resultset object it gives error that resultset is not serialized.
can anybody help me out by providing te code to resolve this.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12268
    
    1
There is a very good reason you can't pass a object implementing java.sql.ResultSet interface.

A ResultSet is very tightly tied to the database statement that creates it. It would be meaningless on the client side.

Instead, extract the data to some format that is Serializable and pass that.

Bill

Java Resources at www.wbrogden.com
Saurabh nitrr
Greenhorn

Joined: Jan 30, 2011
Posts: 5
hey william
please tell me how it can be done
i would like to know the code being used for this purpose
thanks
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12268
    
    1
Since I have utterly no idea about the structure of your data it is impossible to give you anything but vague suggestions.

One of the Java "collection" classes in the java.util package might be suitable, for example an ArrayList will be Serializable and can store a number of objects assuming the client is using Java in the same version as the server.

The subject of moving data around networks in Java is huge and I am not about to try to create a tutorial when there are already many good ones.

Bill
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: passing resulset object to client in rmi
 
Similar Threads
Serialzation is not working
how can return a ResultSet object from a server to client?
Returning ResultSet from an EJB
B&S Is RMI Connection Factory necessary?
Using Sockets to pass an RMI Reference