From: Kris Jurka <books@ejurka.com>
To: David Gagnon <dgagnon@siunik.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Getting the number or row returned by a select. Alway
Date: Fri, 15 Apr 2005 15:04:06 -0500 (EST)
Message-ID: <Pine.BSO.4.56.0504151459290.21687@leary.csoft.net> (raw)
In-Reply-To: <42601BBD.6060307@siunik.com>
References: <20050414154508.66799.qmail@web50407.mail.yahoo.com>
<425EE184.8060303@opencloud.com>
<42601BBD.6060307@siunik.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: books@ejurka.com, dgagnon@siunik.com
Subject: Re: Getting the number or row returned by a select. Alway
In-Reply-To: <Pine.BSO.4.56.0504151459290.21687@leary.csoft.net>
References: <20050414154508.66799.qmail@web50407.mail.yahoo.com> <425EE184.8060303@opencloud.com> <42601BBD.6060307@siunik.com> <Pine.BSO.4.56.0504151459290.21687@leary.csoft.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox