setCharacterStream is not supported

General
Enthusiast

setCharacterStream is not supported

Hi,

          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);

java.io.InputStreamReader isr = new java.io.InputStreamReader(stream, "UTF-8");

stmt.setCharacterStream(1, isr);          

Error:

com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC 14.10.00.26] [Error 165] [SQLState HY000] setCharacterStream: function not supported in this version

Thanks,

Bharani

1 REPLY
Teradata Employee

Re: setCharacterStream is not supported

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.

http://developer.teradata.com/doc/connectivity/jdbc/reference/current/jdbcug_chapter_4.html#CIHHHCIJ