Lists: | pgsql-jdbc |
---|
From: | Alban Mathieu <alban(at)alliancegraphique(dot)ch> |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Driver JDBC3 build 213 for postgreSQL 7.4 |
Date: | 2004-05-19 13:23:58 |
Message-ID: | C8DC433C-A997-11D8-803B-000D93AD2D18@alliancegraphique.ch |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
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???
Best regards
Alban Mathieu
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 |
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
From: | Kris Jurka <books(at)ejurka(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 17:15:30 |
Message-ID: | Pine.BSO.4.56.0405211212220.29942@leary.csoft.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
On Wed, 19 May 2004, Alban Mathieu wrote:
> 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...
>
A lot of people have been using getFetchSize to try and determine the
retrieved ResultSet size which happened to be true in <= 7.3 drivers, but
this is not what the method is actually supposed to do. The 7.4 driver
has cursor based fetching which uses the fetch size for it's intended
purpose. Please consult the javadoc and find a more compliant way of
doing what you want.
Kris Jurka