OracleParameterMetaDataParser.computeBasicInfo - ArrayIndexOutOfBoundsException (Doc ID 1600661.1)

Last updated on SEPTEMBER 19, 2014

Applies to:

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

Symptoms

Running the below code with 12.1.0.1 JDBC driver generates the below exception

String sql = "select /*blah*/ name from btoal.student where name = :1";
ParameterMetaData m = connection.prepareStatement(sql).getParameterMetaData();
System.out.println(String.format("Parameter count = %s", m.getParameterCount()));

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
at oracle.jdbc.driver.OracleParameterMetaDataParser.computeBasicInfo(OracleParameterMetaDataParser.java:199)
at oracle.jdbc.driver.OracleParameterMetaDataParser.getParameterMetaDataSql(OracleParameterMetaDataParser.java:432)
at oracle.jdbc.driver.OracleParameterMetaData.getParameterMetaData(OracleParameterMetaData.java:58)
at oracle.jdbc.driver.OraclePreparedStatement.getParameterMetaData(OraclePreparedStatement.java:11621)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.getParameterMetaData(OraclePreparedStatementWrapper.java:1552)
at JdbcPreparedStatement.main(JdbcPreparedStatement.java:22)

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