IBM Support

The java.lang.ArrayIndexOutOfBoundsException on top of JCC stack.

Technote (troubleshooting)


When the java.lang.ArrayIndexOutOfBoundsException is seen on top of of JCC stack, one of potential causes could be application design issue.


Example of affected JCC stack:

Caused by: java.lang.ArrayIndexOutOfBoundsException

Note that as the JCC driver code is obfuscated, the stack may be different with different JCC driver versions.


The JCC JDBC driver caches cursors associated with prepared statements for future reuse for performance reasons. There is however a tradeoff - a cursor description is not parsed again when a cursor is cached. Hence when underlying DDL of a table changes, the cursor definition may no longer be valid. An application programmer needs to verify that the DDL does not change inbetween subsequent cursor invocations.

Diagnosing the problem

De-obfuscated stack should show that ArrayIndexOutOfBoundsException is raised by T4Cursor.readFdocaOneByte method.

Resolving the problem

Redesign an application or set the useCachedCursor JCC property to false (the default is true )

Related information

URL format for IBM Data Server Driver for JDBC and SQLJ

Document information

More support for: DB2 for Linux, UNIX and Windows
Programming Interface - JCC

Software version: 9.1, 9.5, 9.7, 9.8, 10.1

Operating system(s): AIX, HP-UX, Linux, Solaris, Windows

Reference #: 1622944

Modified date: 24 January 2013

Translate this page: