pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedDriver JDBC3 build 213 for postgreSQL 7.4
3+ messages / 3 participants
[nested] [flat]
* Driver JDBC3 build 213 for postgreSQL 7.4
@ 2004-05-19 13:23 Alban Mathieu <alban@alliancegraphique.ch>
0 siblings, 2 replies; 3+ messages in thread
From: Alban Mathieu @ 2004-05-19 13:23 UTC (permalink / raw)
To: 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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Driver JDBC3 build 213 for postgreSQL 7.4
@ 2004-05-21 05:15 Oliver Jowett <oliver@opencloud.com>
parent: Alban Mathieu <alban@alliancegraphique.ch>
1 sibling, 0 replies; 3+ messages in thread
From: Oliver Jowett @ 2004-05-21 05:15 UTC (permalink / raw)
To: Alban Mathieu <alban@alliancegraphique.ch>; +Cc: 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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Driver JDBC3 build 213 for postgreSQL 7.4
@ 2004-05-21 17:15 Kris Jurka <books@ejurka.com>
parent: Alban Mathieu <alban@alliancegraphique.ch>
1 sibling, 0 replies; 3+ messages in thread
From: Kris Jurka @ 2004-05-21 17:15 UTC (permalink / raw)
To: Alban Mathieu <alban@alliancegraphique.ch>; +Cc: 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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2004-05-21 17:15 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-05-19 13:23 Driver JDBC3 build 213 for postgreSQL 7.4 Alban Mathieu <alban@alliancegraphique.ch>
2004-05-21 05:15 ` Oliver Jowett <oliver@opencloud.com>
2004-05-21 17:15 ` Kris Jurka <books@ejurka.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox