This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and the fly likes Problem with sun.jdbc.rowset.CachedRowSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Problem with sun.jdbc.rowset.CachedRowSet " Watch "Problem with sun.jdbc.rowset.CachedRowSet " New topic

Problem with sun.jdbc.rowset.CachedRowSet

sohane harish

Joined: Jul 21, 2008
Posts: 7
Dear All,

I am using sun.jdbc.rowset.CachedRowSet using CachedRowSet.populate(ResultSet),and creating a copy of this original CachedRowSet and doing some operations on the duplicate copy like deleting.and it's refleting to the original one.i used clone method to create copy and implemented Clonable interface too.below is my code :

CachedRowSet Original_cr =new CachedRowSet();
CachedRowSet duplicate_cr =new CachedRowSet();

now it's deleting first row from the original CachedRowSet too.

Please help me or give any suggetion.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Rather than cloning, I'd try populating from the result set, resetting rs back to the start (before first) and then using it to populate the second CachedRowSet
sohane harish

Joined: Jul 21, 2008
Posts: 7
Hello David,

Thanks for a quick reply,we can do this by ResultSet but actually i wanted to use it by CachedRowSet only,actually i was trying to do paging with on CachedRowSet. I know the paging can be done using using loop and there is another problem my JSP grid where i am populating data it takes the whole CachedRowSet as an Object and display the result. Eg.

Suppose i have 2000 records in CachedRowSet so i m creating 4 different CachedRowSet. which will populate the result. and paging can be done through it.

Please do remember i am using sun.jdbc.RowSet.CachedRowSet
sohane harish

Joined: Jul 21, 2008
Posts: 7
Hello All,

Please help me out...and tell me is it possible or not.

Suppose there are 3000 records on Original CachedRowSet so i would create 3 CachedRowSet like:

CachedRowSet dup_crs1 (which will have 1 to 1000 records)

CachedRowSet dup_crs2 (which will have 1001 to 2000 records)

CachedRowSet dup_crs3 (which will have 2001 to 3000 records)

by using this i can use Paging in my JSP. as my JSP Grid takes one CachedRowSet object and display the result. it doesn't matter how many records are there in CachedRowSet.

If i display 3000 records at one time IE giving me this below message:

A script on this page is causing Internet Explorer to run slowly. If
it continues to run, your computer may become unresponsive

any suggestions from any one will be appricated.

Thanks in advance
I agree. Here's the link:
subject: Problem with sun.jdbc.rowset.CachedRowSet