IBM Support

java.lang.ArrayIndexOutOfBoundsException on the IBM Data Server Driver for JDBC and SQLJ stack

Technote (troubleshooting)


java.lang.ArrayIndexOutOfBoundsException is thrown on the IBM Data Server Driver for JDBC and SQLJ stack when ALTER TABLE modifies a PreparedStatement object's underlying table


When a JDBC application that uses IBM Data Server Driver for JDBC and SQLJ type 2 connectivity to query a table on a Db2 for z/OS data server using a PreparedStatement object, and another application alters the table that is being queried, a java.lang.ArrayIndexOutOfBoundsException is thrown on the driver stack.

Example of an affected JDBC driver stack:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 48







at select_pm47130.main(


Note that because the JDBC driver code is obfuscated, the stack might look different for different driver versions.


To improve performance, when a JDBC application with a type 2 connection uses a PreparedStatement object to query a table, the driver caches the table's metadata information for future reuse. If another application changes the table's definition after the PreparedStatement object is created, the PreparedStatement object might no longer be valid for querying the table.

Diagnosing the problem

The deobfuscated stack trace shows that an ArrayIndexOutOfBoundsException is raised by the T2zosCursor.readFdocaOneByte method.

Resolving the problem

Disable limited block fetch by setting global configuration property db2.jcc.override.enableT2zosLBF or Connection and DataSource property enableT2zosLBF to 2.

Document information

More support for: DB2 for z/OS

Software version: 8.0, 9.0, 10.0, 11.0, 12.0

Operating system(s): z/OS

Software edition: All Editions

Reference #: 2014453

Modified date: 09 March 2018

Translate this page: