This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes ResultSet Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "ResultSet Question" Watch "ResultSet Question" New topic

ResultSet Question

Ashwin Tadepalli

Joined: Feb 01, 2001
Posts: 27
Hi Developers,
I have a question about copying of a resultset object into another ResultSet object. To make it much clear of what I am trying to do, I am retreiving a particular row by using absolute(int) method in a given Scrollable ResultSet object(rs1).Now I want to store somehow the values of that particular row only in a ResultSet object only(either rs1 or in a different one).For this, I was trying to use another Scrollable ResultSet object(rs2) and copy the contents(just 1 one row) in the manner(rs2=rs1).The main reason that I am trying to store them in a ResultSet object is beacuse I have a helper package which takes that particular ResultSet object and displays it. I am having trouble copying in this manner.Could anyone please suggest me a method for doing this or let me know of where exactly I was going wrong?
Thanking you,
Amit Agrawal
Ranch Hand

Joined: Aug 23, 2001
Posts: 282
just Try RowSet.
Rowset is formaly available with jdbc 3.0 and optionaly available with jdbc 2.0. (jdbc3.0 is builtin jdk1.4).
RowSet is derived interface from resultset and there are three classes who implement it. One of them is CachedRowSet, your purpose can be easily achived using the class.
wood burning stoves
subject: ResultSet Question
It's not a secret anymore!