Skip to main content

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


Technote (troubleshooting)


Problem(Abstract)

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

Symptom

Example of affected JCC stack:

Caused by: java.lang.ArrayIndexOutOfBoundsException
at com.ibm.db2.jcc.t4.d.Kb(d.java:2570)
at com.ibm.db2.jcc.t4.e.K(e.java:74)
at com.ibm.db2.jcc.t4.cb.a(cb.java:1814)
at com.ibm.db2.jcc.t4.cb.l(cb.java:387)
at com.ibm.db2.jcc.t4.cb.f(cb.java:98)
...

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

Cause

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

Rate this page:

(0 users)Average rating

Copyright and trademark information

IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.

Rate this page:


(0 users)Average rating

Add comments

Document information

DB2 for Linux, UNIX and Windows

DB2 Programming Interfaces - JCC


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


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


Reference #:
1622944


Modified date:
2013-01-24

Translate my page

Content navigation