Re: Driver JDBC3 build 213 for postgreSQL 7.4 - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Driver JDBC3 build 213 for postgreSQL 7.4
Date
Msg-id 40AD9077.7090905@opencloud.com
Whole thread Raw
In response to Driver JDBC3 build 213 for postgreSQL 7.4  (Alban Mathieu <alban@alliancegraphique.ch>)
List 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

pgsql-jdbc by date:

Previous
From: "Waldomiro"
Date:
Subject: Why is so fast ? is It magic ?
Next
From: henk53602@hotmail.com (henk53)
Date:
Subject: Replicating JDBC proxy