File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Obtain fresh records from database for next and previous buttons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Obtain fresh records from database for next and previous buttons" Watch "Obtain fresh records from database for next and previous buttons" New topic
Author

Obtain fresh records from database for next and previous buttons

smitha rai
Ranch Hand

Joined: Aug 15, 2001
Posts: 33
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

Joined: Jan 27, 2001
Posts: 445
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

Joined: Nov 07, 2000
Posts: 621
"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

Joined: Jun 01, 2002
Posts: 3
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.


Cheers!!!<br />Munuren
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
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
 
GeeCON Prague 2014
 
subject: Obtain fresh records from database for next and previous buttons