File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes (How do i do paging in JSP ????? HELP ME >URGENT 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 » Java » Servlets
Bookmark "(How do i do paging in JSP ????? HELP ME >URGENT" Watch "(How do i do paging in JSP ????? HELP ME >URGENT" New topic
Author

(How do i do paging in JSP ????? HELP ME >URGENT

Deepak B
Greenhorn

Joined: Jun 19, 2001
Posts: 17
thru java server pages(JSP), its huge database ,may be 500000 or more record, i want to display records. in the first page it has first 10 records, next page has next 10 records and so on.. page: 1 2 3 4 5 6 7 8 9 10 (page no) when i select 1, it will show 1st page of first 10 records,if i select 2 it will show 2nd page of records starts from 11 to records 20 ... and so on.....
my back end is: MSSQL 7.0
Deepak
Divyajot Ahluwalia
Ranch Hand

Joined: Nov 03, 2000
Posts: 46
hi deepak,
i can suggest the following:
make a session object and store the existing page no ie 1,2,3,4
use this page number to query the database with limits clause
check the mysql documentation for details. u will get the page number from the session object. multiply the page number with 10 and add 1 so u get the start value. query the db with the start value and extract 10 records.
example of such a query is
SELECT * from tablename where 1 LIMIT 3, 10
here we are picking 10 records starting from the 3rd.
try it out and if any problem let me know
rgds
dj
Raghav Sam
Ranch Hand

Joined: Apr 12, 2001
Posts: 412
hi deepak,
normally the procedure will be to store the records returned in a Vector and iterate as required. but since your record size is huge, the best solution i would imagine is filter the records to a size of 10 at the database level itself, store it in a Vector and display. use a Servlet to do this and have it pass the Vector object to the JSP page.
hope this helps,
raghav.


Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.<br />- Dr. Seuss
Deepak B
Greenhorn

Joined: Jun 19, 2001
Posts: 17
hello Divyajot
Thnx for help , i really need help for execute record page by page , But solution your are talking That Used MySQL Database ,t I tried maney ResultSet Methods doesn't work with MS SQL 7.0, like as u said
/******************************
SELECT * from tablename where 1 LIMIT 3, 10
here we are picking 10 records starting from the 3rd.
/********************************************
This dosen't work with MSSQL 7.0 so can u give me any other solution for this

Thnx
Deepak

Julia Reynolds
Ranch Hand

Joined: May 31, 2001
Posts: 123
Check out this custom tag at jsptags.com:
http://jsptags.com/tags/navigation/pager/
Julia
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: (How do i do paging in JSP ????? HELP ME >URGENT