Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

CachedRowSetImpl , paging  and connection connection

Thread view: 
R - 25 Mar 2006 00:38 GMT
I have been trying to use the CachedRowsetImpl (SUN's reference
Implementation) to run some queries against Oracle.

I am using this mainly because I can do paging by setting the
setPazeSize().

The qurying and paging works okay , but it requires that I keep the
connection open while I am iterating through pages.

That was not my unserstanding from the reading of the API.
I can close it after populating it and the CRS (Cached ResultSet) is
supposed to create the connection from the parameters for subsequent
gets.

Am I missing some thing ?

See the examples below:

String query = "select * from TEST";
conn = dataSource.getConnection(uid , pwd);
PreparedStatement ps = conn.prepareStatement(query,
rs.TYPE_SCROLL_INSENSITIVE,    rs.CONCUR_READ_ONLY );
rs = ps.executeQuery();
crs = new CachedRowSetImpl();
crs.setPageSize(3);
crs.populate(rs,1);

and then iterate through pages works okay. But if I close the
connection after the populate , it only displayes ONE page and then get
an error about connection being closed.

I have tried using the second method of populating the data using
CRS.execute(conn) where conn is connection. If I close the connection
after the execute I get the same error.

I have tried setting the connection params also as below with the same
results:

            crs.setDataSourceName(jndiName);
            crs.setUsername(uid);
            crs.setPassword(pwd);

Any clues >?????
R - 26 Mar 2006 08:48 GMT


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.