db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fantry, John" <JFan...@analogic.com>
Subject Paginating result sets
Date Wed, 19 Jul 2006 18:24:28 GMT

I need some help figuring how to paginate result sets with Derby.  I
have scanned the list archives and have found one similar thread that
never received a complete answer from May 2005.

>From what I understand this pagination behavior is possible in MySQL by
using the 'LIMIT' query.  This will allow me to select the first 100
rows, the second 100 rows, or any arbitrary chunk of rows that may be
part of the result set.

I understand that Derby does not support the LIMIT query.  I also
understand that the JDBC Statement class has two methods that are
related (setFetchSize() and setMaxRows()), but they do not support the
pagination behavior I desire.

So let's say that a given SELECT statement will return 1000 rows.  How
do I create a SELECT statement that will only return me rows 600 - 699?
Having spent a lot of time searching through Derby docs I have concluded
that this is not possible in Derby, but I am hoping I am wrong.

Does anyone know how to do this, or do I have to continue my search for
an embedded database that supports LIMIT?


The information transmitted in this message is confidential and may be privileged.  Any review,
retransmission, dissemination, or other use of this information by persons or entities other
than the intended recipient is prohibited.  If you are not the intended recipient, please
notify Analogic Corporation immediately - by replying to this message or by sending an email
to DeliveryErrors@analogic.com - and destroy all copies of this information, including any
attachments, without reading or disclosing them.

Thank you.
View raw message