Have a look on this approach.
Submit the query information for a page to a Controller ( In this case to a
Servlet ) which will decide what action to be performed.

1. For first page, build the query for 10 rows only. Store all this
information(related to retrieving information) inside a class object, that
in turn will be stored in a Hashmap or a HashTable object(persistent for a
session) corresponding to a unique key . This unique key should be unique
for each type of query. Send the query to the DB using JDBC ( no need of a
EJB layer as it's read-only data -> J2EE Fast Lane Reader Pattern).

Retrieve the data in a Value Object ( No set methods, just get methods)
which will be thrown to the JSP using usebean tag.

2. For the next page, submit to the servlet(no query submission this time).
Get the information about the query from the object stored in HashMap or
Hashtable object corresponding to unique key. Change the skip-rows
parameter( for second page it will be 20) and submit the query to the DB.
Get the data in a Value Object.

3. Previous page -> As above except the change in skip-rows param.

4. Go to page  number something -> As above except the change in skip-rows
param.

Hope it helps.
-ShriKant

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to