Re: ResultSet.getFetchsize() - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: ResultSet.getFetchsize()
Date
Msg-id Pine.BSO.4.56.0409200442370.947@leary.csoft.net
Whole thread Raw
In response to ResultSet.getFetchsize()  ("Jens Hillert" <hillertj@gmx.de>)
List pgsql-jdbc

On Mon, 20 Sep 2004, Jens Hillert wrote:

> Hello,
>
> in previous PostgreSQL JDBC drivers (e.g. 7.3), the Method
> ResultSet.getFetchsize() returned the number of results, which were loaded
> from the database in a query.

This was a complete implementation artifact.  The 7.4+ series now has the
ability to stream results from the server and doesn't have any idea how
many results it will receive until it gets them all, so it can't tell you.

> Or is there another way to get the number of results of a query?
>

You could try ResultSet.moveLast() and then getRow() to determine the
number of results.

Kris Jurka


pgsql-jdbc by date:

Previous
From: "Jens Hillert"
Date:
Subject: ResultSet.getFetchsize()
Next
From: "John R Pierce"
Date:
Subject: Re: "Idle in Transaction" revisited.