Re: Driver JDBC3 build 213 for postgreSQL 7.4

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Alban Mathieu <alban(at)alliancegraphique(dot)ch>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Driver JDBC3 build 213 for postgreSQL 7.4
Date: 2004-05-21 05:15:35
Message-ID: 40AD9077.7090905@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Alban Mathieu wrote:
> Hi,
>
> I got some troubles with the jdbc driver build 213 for postgreSQL 7.4
> The method ResultSet.getFetchSize() return always 0
>
> I use now the driver for postgreSQL 7.3 and evrything is working fine...
>
> Any idea???

If you are expecting getFetchSize() to return the size of the resultset,
that was nonstandard behaviour in the older driver. Newer drivers follow
the JDBC API specification and return whatever was set by setFetchSize()
(or an unspecified default value).

To get the resultset size portably, try something like:

PreparedStatement stmt =
connection.prepareStatement("...",
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
// .. set parameters ..
ResultSet rs = stmt.executeQuery();
rs.last();
int resultSetSize = rs.getRow();

-O

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Andrea Aime 2004-05-21 06:14:58 Re: Queries with large ResultSets
Previous Message Oliver Jowett 2004-05-20 22:54:43 Re: Queries with large ResultSets