db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Lichtman <swa...@rcn.com>
Subject Re: Numer or rows in result?
Date Tue, 17 May 2005 05:57:34 GMT

>         I can't seem to find a way to get the number of rows in the
>         current result via JDBC.  Is there a way to get the number of
>         rows in the result?

There is no such method, mainly because it is impossible for a DBMS to know 
in advance how many rows will be in the result, except in a few special 
cases (e.g. exact match on a unique key). The only way to figure out how 
many rows there are is to fetch them all. Most database systems fetch rows 
only on demand whenever possible to improve response time, save resources 
and improve concurrency.


                        -        Jeff Lichtman
                                 swazoo@rcn.com
                                 Check out Swazoo Koolak's Web Jukebox at
                                 http://swazoo.com/ 


Mime
View raw message