• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Deepak B
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out this custom tag at jsptags.com:
http://jsptags.com/tags/navigation/pager/
Julia
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic