It would be unusual to actually store n numbers of html pages acording to the
length of the ResultSet. It seems to me there are various options though which
serve the purpose you imply.

1. Only retrieve a pre-defined section of data at a time from the db with your SQL.
e.g. for the first page select * from database_table order by update_date limit 10,
second page limit 10,10 ad infinitum

2. Retrieve a unique reference for each result the first time around, stick them
all in a vector, array, or some other kind of storage, and stick that in the
session. Then call the database for a selection of those references for each page
you serve.

3 (a more sophisticated version of 2). Put a wrapper around the ResultSet (they're
not safe to put in the session presuming you're using connection pooling) to put in
the session, and show a chunk at a time from that using cursors or something
similar to mark your current point.

4. You _could_ write out static html pages. This is only useful if the data changes
(very) slowly.

5. Pre-prepare html pages and cache them in a Hashtable, ready to be viewed. then
call them back by page number. If the pages are going to be repeatedly looked at
and memory isn't lacking this is viable, otherwise stick with the more dynamic
methods.

6. Probably lots more much more efficient/effective ways I can't think of/don't
know..

- simon

Yuki Tanabe wrote:

> I want to write a servlet whose number of html pages generated depend on the
> size of a ResultSet. Ideally the servlet will generate a html page with a
> pointer to the next page and/or previous page. What I don't understand is where
> are the pages created on the fly by the servlet stored? Could someone point me
> to a suitable reference manual or give me some explanation?
>
> T.A.
>
> Yuki
>

___________________________________________________________________________
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