posted 23 years ago
1. Put the entire result set into a collection of some kind ( array, or any collection object from java.util). If the rows of your query can be represented as objects, then create an object for each one and store the collection of objects as an ArrayList. Put the collection into the users's session, like this: session.setAttribute( "pageResults", myCollection );
2. create a page that displays the first N objects in your collection.
3. create a forward and backward links in your page that are numbered, with each number corresponding to N items in your collection. For example, if N=20 and page number is 0, you display the first 20 items; if page number is 1, you display items 21-40, etc. Of course if you're on the first or last page the backward and forward links should be disabled, respectively.
4. create an OutofMemory Error if result set is large
Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD