From: Oliver Jowett <oliver@opencloud.com>
To: tmp@nitwit.de
Cc: pgsql-jdbc@postgresql.org
Subject: Re: cursor "jdbc_curs_1" does not exist
Date: Fri, 18 Jun 2004 01:17:03 +1200
Message-ID: <40D199CF.1050101@opencloud.com> (raw)
In-Reply-To: <200406171449.12604.tmp@nitwit.de>
References: <200406151736.27450.tmp@nitwit.de>
<200406151853.58666.tmp@nitwit.de>
<Pine.BSO.4.56.0406151234060.10395@leary.csoft.net>
<200406171449.12604.tmp@nitwit.de>
tmp@nitwit.de wrote:
> And why doesn't this work:
>
> db.setAutoCommit(false);
>
> final Statement select =
> db.createStatement(ResultSet.HOLD_CURSORS_OVER_COMMIT,
> ResultSet.CONCUR_READ_ONLY);
You are passing the wrong constants here. The first argument to
createStatement should be the resultset type constant (ResultSet.TYPE_*)
not a cursor holdability constant.
You probably meant:
final Statement select = db.createStatement(ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
The current driver will throw an exception if you try this, as
HOLD_CURSORS_OVER_COMMIT is not supported (actually, it throws in *all*
cases if you use the three-arg createStatement method -- I have that
fixed in my tree)
I note that the current driver returns true from
DatabaseMetadata.supportsResultSetHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT)
which is wrong.
-O
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: oliver@opencloud.com, tmp@nitwit.de
Subject: Re: cursor "jdbc_curs_1" does not exist
In-Reply-To: <40D199CF.1050101@opencloud.com>
References: <200406151736.27450.tmp@nitwit.de> <200406151853.58666.tmp@nitwit.de> <Pine.BSO.4.56.0406151234060.10395@leary.csoft.net> <200406171449.12604.tmp@nitwit.de> <40D199CF.1050101@opencloud.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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