• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

passing resulset object to client in rmi

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Saurabh nitrr
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Acetylsalicylic acid is aspirin. This could be handy too:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic