Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Using resultset to encapsulate data and pass by

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am working on an academic distributed database project. I will appreciate if someone can give me advice on this.

I receive a distributed query from user and gather the required data from nodes. Now I want to put it in a Resultset and pass it to the user (so that he can iterate over it etc.).

1- Is it possible in a simple way to use JDBC's Resultset object to encapsulate my data and pass it to the user in response to his distributed query or I should rather use my own custom structures?

2- Java's Resultset object needs a live connection even if I already have all the records available (limited set) ? In my current solution each query fetches all the needed rows (I assume limited number of rows) from different nodes and combines them in an array. Is it possible to use Resultset without involving an open Connection object to pass this information?

Thank you very much for your help.

Regards,
Mac
[ March 05, 2008: Message edited by: Siamak Saarmann ]
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Distributed usually implies the need for serialization, and result sets are not Serializable. I'd use a Collection to encapsulate the results (that is the normal pattern).

You can use a CachedRowSet to get an ResultsSet you can operate on without a DB connection.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This may be interesting to you...

http://www.longbrothers.net/brad/

Main paper:

Distributed result set iterator: a design pattern for efficient retrieval of large result sets from remote data sources

and its supplement (at bottom of page):

Sorting non-key fields in the distributed result set iterator pattern
 
Siamak Saarmann
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Xagyg, thank you very much. Even though I have almost done the project, the paper should be very useful.

Mac
 
Destroy anything that stands in your way. Except this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic