problem with CLOB UPDATE in new JDBC 1.40 driver
Posted in 1999
Hello -- I just downloaded the new JDBC 1.40 driver and am trying to use it to handle CLOB data in an Informix 9.1.4 database. I've been able to use the new driver to extract CLOB fields using SELECT statements, and I've been able to put new data into CLOB fields using INSERT, but I've found that I can't use UPDATE to update CLOB fields. Here's my code for INSERT, which works fine: PreparedStatement ps = conn.prepareStatement("INSERT INTO my_table (uid, raw_data) VALUES (?,?)"); ps.setInt(1, 999); byte block[] = new String("This is insert data").getBytes(); ByteArrayInputStream bs = new ByteArrayInputStream(block); ps.setAsciiStream(2, bs, block.length); int nRows = ps.executeUpdate(); And here's the code for UPDATE, which produces an exception with the error "No cast from byte to clob": PreparedStatement ps = conn.prepareStatement("UPDATE my_table SET raw_data = ? WHERE uid = 1"); byte block[] = new String("This is update data").getBytes(); ByteArrayInputStream bs = new ByteArrayInputStream(block); ps.setAsciiStream(1, bs, block.length); int nRows = ps.executeUpdate(); Is this a known problem? The same code works fine with the INTERSOLV 3.11.00.07 32-BIT INFORMIX ODBC driver through the JDBC-ODBC bridge. I've also tried setBinaryStream, but I have exactly the same problem. thanks, chris ----------------------- Christopher Weiland Director of Development Ignite Sports Media LLC chrisw@ignitemedia.com ----------------------- -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own