BUG #1780: JDBC driver "setNull" throws for BLOB and CLOB columns

From: "Andrus Adamchik" <andrus(at)objectstyle(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1780: JDBC driver "setNull" throws for BLOB and CLOB columns
Date: 2005-07-22 08:45:46
Message-ID: 20050722084546.98737F0B16@svr2.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-jdbc


The following bug has been logged online:

Bug reference: 1780
Logged by: Andrus Adamchik
Email address: andrus(at)objectstyle(dot)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)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Ing. Jhon Carrillo - Caracas, Venezuela 2005-07-22 14:12:17 Re: Postmaster already running !!!
Previous Message Sivaraman K.G 2005-07-22 06:30:52 Postmaster already running !!!

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2005-07-22 12:09:39 Re: Timestamp Conversion Woes Redux
Previous Message Heikki Linnakangas 2005-07-22 06:54:10 Re: jdbc xa support