Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

ResultSet Paginating

  Asked By: Jamil    Date: Aug 29    Category: Java    Views: 616
  

Does anybody know any kind of pattern or technology for paginating a
ResultSet ?
Let's say that my select will return over 5000 records, and I'd like to
show them 10 at a time.
What's the best method ?

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Jaime Bowman     Answered On: Aug 29

Better to use Enumeration..............

 
Answer #2    Answered By: Brandon Tucker     Answered On: Aug 29

If u fetch the result in XML format ,you could set skip rows and max rows
before fetching the data.

 
Answer #3    Answered By: Al Allen     Answered On: Aug 29

select * from table offset,pagesize;

 
Answer #4    Answered By: Viola Hanson     Answered On: Aug 29

if you have the 5000 records in memory then its best to deal with that
how you decide. if java is client side, then its not such an issue.
however, if you want to save server side load then its best to do
selects at the user's request, so;

select count['*'] from table;

now you know the number of records.

then paginate those records at the user's request. it is unlikely that
the user wants all 5000 records in 99% of cases, consider google's
paginated records, how many people will look at them all.

 
Didn't find what you were looking for? Find more on ResultSet Paginating Or get search suggestion and latest updates.




Tagged: