• 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

Problem with sun.jdbc.rowset.CachedRowSet

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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();
Original_cr.populate(rs);
CachedRowSet duplicate_cr =new CachedRowSet();
duplicate_cr=(CachedRowSet)Original_cr.clone();
duplicate_cr.absolute(1);
duplicate_cr.deleteRow();

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

Please help me or give any suggetion.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic