db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Robertson <b...@tekbot.com>
Subject What is the recommended way to page result sets?
Date Fri, 06 Jul 2007 12:17:49 GMT
First off, I would like to categorically state that Apache Derby is one 
of the most fantastic things to come down the pike in Java's history.  I 
make sure to push it whenever the opportunity presents itself. 

Thanks to everybody.

I am working on a not too complicated gui program with an embedded derby 
store.  If the program stays in service long enough, I can see some of 
the queries returning result sets on the order of several thousand rows. 

My initial idea is to use a scrollable result set, grab the first chunk, 
close the result set, display them, and if the user asks for more, 
repeat the query, advance n rows (ResultSet.relative()), and repeat.

If I do this, will Derby begin to fetch rows as soon as I execute the 
query, and I will therefore waste a lot of time?  Does skipping rows 
involve reading them all?  i.e. is that a linear operation?  Is there a 
better way to do this?


View raw message