aspose file tools*
The moose likes JSP and the fly likes Splitting records in pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Splitting records in pages" Watch "Splitting records in pages" New topic
Author

Splitting records in pages

vasudevan gopalan
Greenhorn

Joined: Jul 09, 2000
Posts: 7
Hi everybody,
In JSP how to split the records so that only a certain number of records can be shown at a time.For eg 10 records in first page and next 10 records in second page and so on.
bye
Vasu
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

There is a good conversation on paging resultsets in this thread in the JDBC forum.
Dave
ramkumar chandramohan
Greenhorn

Joined: Nov 19, 2001
Posts: 17
hi vasu,
let me know ,What is ur primary key ie int ,string etc,
if int it is easy.
ram
Originally posted by vasudevan gopalan:
Hi everybody,
In JSP how to split the records so that only a certain number of records can be shown at a time.For eg 10 records in first page and next 10 records in second page and so on.
bye
Vasu

vasudevan gopalan
Greenhorn

Joined: Jul 09, 2000
Posts: 7
hai ram,

i am using string datatype as primary key
bye,
vasu
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

After searching the JDBC forum, I really recommend you read these two threads.
Dave.
ramkumar chandramohan
Greenhorn

Joined: Nov 19, 2001
Posts: 17
hi vasu,
Then you need to use Vectors to display all the records.
Originally posted by vasudevan gopalan:
hai ram,

i am using string datatype as primary key
bye,
vasu

David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Originally posted by ramkumar chandramohan:
hi vasu,
Then you need to use Vectors to display all the records.

ramkumar, I think your answer ignores all the possible complications. Ignoring the fact the Vector isn't too efficient, if we store it in an object (of some sort) then we have to hold onto this object, which can take up significant resources, the data that produced the results can change in the background and the "object" won't refect that change, and if you are talking hundreds to thousands of rows with a whole lot of large attributes can add up to megs of data per person...
Just think the solution has to be discussed in context rather than offering a broad solution.

Dave.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Splitting records in pages