Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » J2EE Interest »

Re: Caching a Resultset

Shivprasad_Bade

2005-02-08


Hi,
 
I heard abt CachedRowSet but never used it myself so don't know if it helps or not
 
For more info
 
http://www.javaworld.com/javaworld/jw-02-2001/jw-0202-cachedrow.html
 
-
 
Regards,
 
Have a nice day..!!!
 
Shivprasad Bade
 
Logic will get you from A to B - imagination will take you anywhere.
 


From: A mailing list for Java(tm) 2 Platform, Enterprise Edition [mailto:J2EE-INTEREST@JAVA.SUN.COM] On Behalf Of Kalra, Ashwani
Sent: Tuesday, February 08, 2005 8:56 PM
To: J2EE-INTEREST@JAVA.SUN.COM
Subject: Re: Caching a Resultset

Do not fetch all the records from DB. Fetch certain no of records and cache them. When user hits next button and the record is not there, hit the database again and fetch the records again. In my application I am caching 5 pages of records. This incluldes 1 page backward , 1 current page and 3 forward pages. I keep on moving this window as user  progresses to the next page and when he hits the page which is not in cache.
 
/ Ashwani


 

-----Original Message-----
From: Sanjeev K.R [mailto:sanjeevkoppal@YAHOO.COM]
Sent: Tuesday, February 08, 2005 3:24 PM
To: J2EE-INTEREST@JAVA.SUN.COM
Subject: Caching a Resultset

Hi,
We have around 20000 - 40000 of record in a table,
We are using JSP and a front controller(Servlet) and some DAO's
We have implemented Pagination also....
We have a performance set back,we are displaying 10 record at a time in a page,
We are using the absolute potion of the ResultSet to fetch the next 10 records,
can anyone help me in achiving a better performance,
I cannot built all the 20000 objects at the same time in my DAO,
How can i cache the result set? or the query.....
My code goes some thing like this...
[
DBConnection dbConn = manager.getConnection();
Statement stmt = dbConn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
EnquireMaintainOrderVO enquireOrder=((EnquireMaintainOrderVO)query);
ResultSet rs = stmt.executeQuery(getQuery(enquireOrder));
rs.absolute(((Integer)param).intValue());
]
Please can anyone throw some light on this ASAP..
 
 
Thanks & regards
Sanjeev
 


Do you Yahoo!?
Yahoo! Mail - You care about security. So do we. =========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".

=========================================================================== To unsubscribe, send email to listserv@java.sun.com and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@java.sun.com and include in the body of the message "help".

©2008 junlu.com - Jax Systems, LLC, U.S.A.