posted 14 years ago
Hi guys,
I got a general question about pagination. I implemented an interface to retrieve some data from the db and to display them as 20 per page.
This could be done by
Either by retrieving all the data and store them in a data structure like ArrayList for example
Or retrieving them from the database as 20 per time.
My question is which way is better.
Obviously, the former way is better if the retrieved data is heaps to store in ArrayList as the size of ArrayList is hugh which takes up memory.
However, the second way, open too many connections because each clicking on the pagination will be one retrieve to the database also. Is it this overhead?
Can someone please advise?
Thanks.
SCJP 5.0 <br />-> Change job<br />-> Decide another cert to do