Re: Getting the number or row returned by a select. Alway - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Getting the number or row returned by a select. Alway
Date
Msg-id Pine.BSO.4.56.0504151459290.21687@leary.csoft.net
Whole thread Raw
In response to Getting the number or row returned by a select. Alway tought it was not possible until I say pgAdmin who gives it  (David Gagnon <dgagnon@siunik.com>)
List pgsql-jdbc

On Fri, 15 Apr 2005, David Gagnon wrote:

> So did I miss something obvious.  Is it possible to get the total number
> of row returned from a query without doing another select.
>

Anytime you've got the results of a query you can loop over it to count
the number of elements.  In JDBC with a scrollable ResultSet you may issue
rs.last() and rs.getRow() to get the number of rows.  rs.beforeFirst()
will then reset the ResultSet back to its original state.

Kris Jurka

pgsql-jdbc by date:

Previous
From: David Gagnon
Date:
Subject: Getting the number or row returned by a select. Alway tought it was not possible until I say pgAdmin who gives it
Next
From: "amp"
Date:
Subject: Have Question