I am retrieving thousands of rows from the database, but I want to display only about 200 on one jsp. I am using pagination by creating links to the next rows.
Currently using DB2, the only thing I can do is a FETCH FIRST 200 rows. So by the time I get to the 5th page, I am doing a FETCH FIRST 1000 rows and then I am displaying 800 to 1000.
Can anyone suggest a better solution, either from the jsp, but preferably from the DB perspective?
These are read-only records i.e I am only displaying them. Also, these pages are not within a session or anything, so I dont want to keep any cursors around.
Thanks.