Home > Archive > PostgreSQL Bugs > July 2005 > BUG #1780: JDBC driver "setNull" throws for BLOB and CLOB columns









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

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

2005-07-22, 9:26 am


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. AbstractJdbc2Stateme
nt. setNull(AbstractJdbc
2Statement.j
ava:1003)
at
org.postgresql.jdbc3. AbstractJdbc3Stateme
nt. setNull(AbstractJdbc
3Statement.j
ava:1445)
at NullBlob.main(NullBlob.java:24)

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com