Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Page wise display

 
aakash bhatt
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I had a doubt what bean should I use when I want to populate data page wise.
Maximum in one page he can see 10 records while pressing on next page he gets another 10 record
How should I populate the next 10 records where my records in a table is more than a lakh and
performance is an issue.
Regards,
aakash
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a Design Pattern aimed at this very problem. It is from the Core J2EE Patterns book and is called the Value List Handler Pattern. Check it out here: Value List Handler.
[ January 15, 2003: Message edited by: Chris Mathews ]
 
rastin purr
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which is a better way, to get say all the records (say 100 of them) and returned as an iteration. Display 10 of them and when next is clicked, display the next of them from the iterator returned. Or, get 10 of them (return as iterator). When next is clicked, do another search and get the next 10 and return as iterator instance to be displayed.
In the first the overhead is huge but for subsequent list it is easier. Am i correct so far? please suggest.
ras
 
Thomas Taeger
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rastin,
I asked the customer how many rows we had to expect and the amount of data per row.
He said "unlimited".
So I implemented the second way you propose.
Thomas.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic