java.sql.SQLException: Bigger type length than Maximum With Fetch size 65536 (Doc ID 978572.1)

Last updated on SEPTEMBER 01, 2014

Applies to:

JDBC - Version 11.1.0.6 to 11.1.0.7 [Release 11.1]
Information in this document applies to any platform.
***Checked for relevance on 30-Apr-2012***

Symptoms

While using JDBC driver Fetchsize of 65535 with 11.1.0.6 JDBC driver to connect to 11.1.0.6 database fails with following exception.

Exception trace:-
Exception in thread "main" java.sql.SQLException: Bigger type length than Maximum
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:120)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:137)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:250)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:330)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:355)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:598)
at oracle.jdbc.driver.T4CMAREngine.buffer2Value(T4CMAREngine.java:2428)
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB2(T4CMAREngine.java:1153)
at oracle.jdbc.driver.T4C8TTIrxh.unmarshalV10(T4C8TTIrxh.java:113)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:685)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:1039)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:1146)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1472)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3889)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3959)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:4515


Code snippet

private static final int MAX_FETCH_SIZE = 65536;
PreparedStatement statement = connection.prepareStatement("SELECT * FROM SampleTable WHERE ID=?");
statement.setLong(1, 10);
statement.setFetchSize(MAX_FETCH_SIZE);

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