This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JDBC and the fly likes Pagination jsp/java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Pagination jsp/java" Watch "Pagination jsp/java" New topic
Author

Pagination jsp/java

arun ramk
Greenhorn

Joined: Aug 09, 2008
Posts: 26
Hi all,
My requirement is to display around 1 lakh records to user in UserInterface(WEB APPLICATION - JAVA1.5/JSP/STRUTS/TOMCAT 4.1.29/ORACLE 9i). I know pagination is the better way to implement this. I am supposed to display 50 records per page. Tell me what is the better way to handle this. Either to get all the 1lakh records in a single fetch from database and show sets of 50 records to user or fetch data from database whenever the user clicks pagination links to fetch the particular 50 records.
I hope fetching the entire set of (1 lakh) records in one go is better. But where will i store them? Is it possible to store in a cache if so How?
I heard something about CachedRowSetImpl in JDBC. Can i store all the one lakh records in CachedRowSetImpl object. Will it affect performance (memory). Will it be scalable if more users request the page. My important requirement is to display the first page with first 50 records as quick as possible to user (around 15 secs).
Could anyone please suggest me the best possible approach to go ahead with pagination with above requirements. Your help is highly appreciated. Thanks in advance.
Shikhar Madhok
Ranch Hand

Joined: Dec 18, 2006
Posts: 95
Check the article by Deepak Bala in the August edition of JavaRanch Journal.
Personally, I would display 50 records at a time and not get all the 100,000 records in one shot. Can't imagine what use it would be to the user unless he plans to download the result to analyze it further.

HTH
Shikhar


He who asks a question is a fool for five minutes; he who does not ask a question remains a fool forever - Chinese proverb
 
wood burning stoves
 
subject: Pagination jsp/java