From: Andrus Adamchik <andrus@objectstyle.org>
To: pgsql-bugs@postgresql.org
Subject: BUG #1780: JDBC driver "setNull" throws for BLOB and CLOB columns
Date: Fri, 22 Jul 2005 09:45:46 +0100 (BST)
Message-ID: <20050722084546.98737F0B16@svr2.postgresql.org> (raw)
The following bug has been logged online:
Bug reference: 1780
Logged by: Andrus Adamchik
Email address: andrus@objectstyle.org
PostgreSQL version: 8.0.1
Operating system: Mac OS X 10.4
Description: JDBC driver "setNull" throws for BLOB and CLOB columns
Details:
Whenver I call PreparedStatement.setNull(int, int) on BLOB or CLOB columns,
an exception below occurs. Driver version: postgresql-8.0-310.jdbc3.jar. But
looks like latest CVS version has the same problem.
Test case:
Driver d = new org.postgresql.Driver();
Properties p = new Properties();
p.put("user", "andrus");
p.put("password", "andrus");
Connection c =
d.connect("jdbc:postgresql://localhost:5432/cayenne", p);
PreparedStatement st = c
.prepareStatement("insert into BLOB_TEST (BLOB_TEST_ID,
BLOB_COL) values (?, ?)");
st.setInt(1, 1);
// this is the line where it blows:
st.setNull(2, Types.BLOB);
Stack trace:
org.postgresql.util.PSQLException: Unknown Types value.
at
org.postgresql.jdbc2.AbstractJdbc2Statement.setNull(AbstractJdbc2Statement.j
ava:1003)
at
org.postgresql.jdbc3.AbstractJdbc3Statement.setNull(AbstractJdbc3Statement.j
ava:1445)
at NullBlob.main(NullBlob.java:24)
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: andrus@objectstyle.org, pgsql-bugs@postgresql.org
Subject: Re: BUG #1780: JDBC driver "setNull" throws for BLOB and CLOB columns
In-Reply-To: <20050722084546.98737F0B16@svr2.postgresql.org>
References: <20050722084546.98737F0B16@svr2.postgresql.org>
* 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