Need Help Urgently For Displaying RESULTS PER PAGE

i am comiling a serch engine throgh JSDK servlets and using a personal Oracle database. i currently have over 2000 records and when they are returned they are all being returned in one big table. i am trying to get the servlet to display so many results per page, for example 30 per page. I am at a loss on how to do this and have tried a number of methods, i urgently need to find a way of doing this as it is for a Major school project. I hope someone can help me i would be extremly greatful if someone could. Please

Thanks

[540 byte] By [Nevillejohna] at [2007-9-19]
# 1
See this article about J2EE design patterns: http://developer.java.sun.com/developer/technicalArticles/J2EE/J2EEpatterns/in particular the section headed "Page-by-Page Iterator Problem Domain".
DrClapa at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hello --

One way to do this would be something like this:

1. Start out with a page where filtering parameters could be entered, submit to the servlet with a starting position of 0.

2. Grab all the rows from the oracle database, toss them in an array.

3. Draw items in a table from the starting position to the number of entries per page from the array.

4. Put a Previous and Next button on the results page to submit back to the servlet in step 2 where the starting position is the current position - number of results per page for previous, next is the has a starting position of current position + number of results per page. You'll want to do range checking, etc on this.

The key trick is to ask one servlet to do steps 2-4. I've used hidden variables on the form with some javascript to set the new starting parameter for previous and next. You could assemble a URL in javascript also.

There are probably slicker ways to do this, but for 2000 rows, it should probably work well enough.

Good luck.

Donn

daikena at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...