Recordset

Tim Panton - Westhawk Ltd tpanton at ibm.net
Sat Nov 12 19:29:10 PST 2005


What I've done was:
	give each record a unique key
which is an int call it 'id'.
	on the first page request, do a query which returns all the matching
ids in an array. Put the array in the session.
	for all page requests, retreive
the required data for records with
ids matching the first 20 (or 20-40)
elements in the array.

This requires 2 data base round trips, but the memory requirement
is manageable, and its behaviour
wrt inserts and deletes occuring between page requests is sane.

"Jeff Gutierrez" <jeff at intertainer.com> wrote:
__________
>Hi Carlos,
>
>If you're using JDBC 2.0, you're in luck.  Here's what you can do:
>
>- on a valid Resultset, call  youresultsef.last()  -- last() moves the
>cursor to the last row in the result set.
>- then call getRow() which returns the row number of the current row.
>
>JDBC1.x does not have the methods and I don't know of any workaround to get
>to the row number apart from externally counting the rows.   Anybody know a
>good technique?
>
>HTH
>
>jeff --
>
>

Tim.
---
URL http://www.westhawk.co.uk/

---
To unsubscribe, mail advanced-java-unsubscribe at xcf.berkeley.edu
To get help, mail advanced-java-help at xcf.berkeley.edu



More information about the Advanced-java mailing list