Re: ResultSet implementation - Mailing list pgsql-jdbc

From Nic Ferrier
Subject Re: ResultSet implementation
Date
Msg-id 87znkg2a96.fsf@pooh-sticks-bridge.tapsellferrier.co.uk
Whole thread Raw
In response to ResultSet implementation  ("Sean Devlin" <seandevlin37@hotmail.com>)
List pgsql-jdbc
"Sean Devlin" <seandevlin37@hotmail.com> writes:

> Hello,
>
> I would like to know if PG's implementation of ResultSet caches all or only
> some of the rows returned from a query.  If the RS implementation does fetch
> blocks of data as it iterates, how many rows are retrieved at a time?.. or
> does this number fluctuate? etc.

Normally pg-jdbc fetches ALL the results from a query and caches
them. The reason it does that is because it's the best option most of
the time.

With the driver in CVS it is possible to alter that behaviour. Just
turn off auto-commit and set the fetch size to the number of rows you
want cached.

When you do that the driver switches to a cursor querying
mechanism.

This is not in the released driver yet. I think it's planned for 7.4
but one of the core JDBC hackers will be able to confirm that.


Nic

pgsql-jdbc by date:

Previous
From: "Sean Devlin"
Date:
Subject: ResultSet implementation
Next
From: Darin Ohashi
Date:
Subject: Bug in ResultSet.moveToCurrentRow