dbTalk Databases Forums  

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

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1780: JDBC driver "setNull" throws for BLOB and CLOB columns in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andrus Adamchik
 
Posts: n/a

Default [BUGS] BUG #1780: JDBC driver "setNull" throws for BLOB and CLOB columns - 07-22-2005 , 09:08 AM







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("jdbcostgresql://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.setNul l(AbstractJdbc2Statement.j
ava:1003)
at
org.postgresql.jdbc3.AbstractJdbc3Statement.setNul l(AbstractJdbc3Statement.j
ava:1445)
at NullBlob.main(NullBlob.java:24)

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

http://archives.postgresql.org

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.