java.sql.SQLException: Protocol violation When Reading CLOB (Doc ID 1616830.1)

Last updated on APRIL 05, 2017

Applies to:

JDBC - Version 12.1.0.1.0 and later
Information in this document applies to any platform.

Symptoms


When reading clobs from AL32UTF8/UTF-8 database, the JDBC thin driver returns the error Protocol violation: [ 14, 121, ]

The problem usually occurs  when a clob data of length 4193 is selected from a table in a UTF-8/AL32UTF8 database.


Caused by: java.sql.SQLException: Protocol violation: [ 0, ]
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:669) ~[ojdbc7.jar:12.1.0.1.0]
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:249) ~[ojdbc7.jar:12.1.0.1.0]
at oracle.jdbc.driver.T4C8TTIBlob.createTemporaryLob(T4C8TTIBlob.java:182) ~[ojdbc7.jar:12.1.0.1.0]
at oracle.jdbc.driver.T4CConnection.createTemporaryBlob(T4CConnection.java:3197) ~[ojdbc7.jar:12.1.0.1.0]
at oracle.sql.BLOB.createTemporary(BLOB.java:806) ~[ojdbc7.jar:12.1.0.1.0]
at oracle.jdbc.driver.OraclePreparedStatement.setBinaryStreamContentsForBlobCritical(OraclePreparedStatement.java:7615) ~[ojdbc7.jar:12.1.0.1.0]
at oracle.jdbc.driver.OraclePreparedStatement.setBlobInternal(OraclePreparedStatement.java:12445) ~[ojdbc7.jar:12.1.0.1.0]
at oracle.jdbc.driver.OraclePreparedStatement.setBlob(OraclePreparedStatement.java:12154) ~[ojdbc7.jar:12.1.0.1.0]
at oracle.jdbc.driver.OraclePreparedStatementWrapper.setBlob(OraclePreparedStatementWrapper.java:569) ~[ojdbc7.jar:12.1.0.1.0]
at weblogic.jdbc.wrapper.PreparedStatement.setBlob(PreparedStatement.java:1269) ~[com.bea.core.datasource6_1.10.0.0.jar:1.10.0.0]

java.io.IOException: Protocol violation: [ 14, 121, ] at
 oracle.jdbc.driver.OracleClobReader.needChars(OracleClobReader.java:264) at
 oracle.jdbc.driver.OracleClobReader.read(OracleClobReader.java:195) at
 Ojdbc7ClobReaderTest.main(Ojdbc7ClobReaderTest.java:26) Suppressed:
 java.sql.SQLException: Protocol violation: [ 0, ] at
 oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:669) at
oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:249) at
 oracle.jdbc.driver.T4C7Ocommoncall.doOLOGOFF(T4C7Ocommoncall.java:59) at
 oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:757) at
 oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:4585) at
 Ojdbc7ClobReaderTest.main(Ojdbc7ClobReaderTest.java:29) Caused by:
 java.sql.SQLException: Protocol violation: [ 14, 121, ] at
 oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:669) at
 oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:249) at
 oracle.jdbc.driver.T4C8TTIClob.read(T4C8TTIClob.java:245) at
 oracle.jdbc.driver.T4CConnection.getChars(T4CConnection.java:3901) at
 oracle.sql.CLOB.getChars(CLOB.java:517) at
 oracle.jdbc.driver.OracleClobReader.needChars(OracleClobReader.java:245)



Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms