Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Obtain fresh records from database for next and previous buttons

 
smitha rai
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to display records from the database in a shot of 20. The database may contain as many records. Whenever, I move next and previous screens (using jsp page), I need to query the database using the start and finish indices so that always the recent data is always displayed. In other words, I need to query the database every time.
Can any one help me with the code to retreive the result set having ONLY 20 records or less.?
regards,
Smitha
 
Vedhas Pitkar
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!HAve u tried the paging taglib from www.jsptags.com .It's really great & soilves almost all ur needs.
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"smitha",
Thanks for participating here at the Ranch. However, the name you are using does not comply with our naming convention described at http://www.javaranch.com/name.jsp . Please log in with a new name, which meets these requirements.
You can change your name here.
Thanks.
Sean
 
Munuren Burh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Smitha,
This will be database specific.If you are using MySql then you have to retrive all data in an array or vector and then display in a slots.
I think in case of Oracle the specific query is available to display the rows in a slot.
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi smitha...
this question has been answered many a times in this forum...
i wud suggest you to search for "paging" in this forum
that wud definately help
malhar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic