All Forums General
bmani 6 posts Joined 10/13
10 Apr 2014
setCharacterStream is not supported

          I want to save unicode string to a clob column in database. The code is shown below and I get function not supported error. Is there a workaround for this problem? How do you set unicode string for a clob?

byte[] json = jsonResponse.getBytes("UTF-8");

InputStream stream = new ByteArrayInputStream(json); isr = new, "UTF-8");

stmt.setCharacterStream(1, isr);          
com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC] [Error 165] [SQLState HY000] setCharacterStream: function not supported in this version

tomnolan 594 posts Joined 01/08
14 Apr 2014

The PreparedStatement setCharacterStream method with 2 arguments is not supported yet by the Teradata JDBC Driver.
Instead, you need to use the PreparedStatement setCharacterStream method with 3 arguments, which is supported. Please note that the Teradata JDBC Driver User Guide is available here on Developer Exchange, and it lists all the methods supported by the Teradata JDBC Driver.

You must sign in to leave a comment.