java.lang.StringIndexOutOfBoundsException occurs when connecting from WebSphere Application Server v5.x to DB2 UDB for iSeries
 Technote (troubleshooting)
 
Problem(Abstract)
A java.lang.StringIndexOutOfBoundsException: String index out of range: 3 occurs when using the DB2® Legacy CLI-based Type 2 driver to connect from WebSphere® Application Server to DB2 UDB for iSeries® (AS/400®).
 
Cause
The problem stems from an unsupported JDBC™ driver configuration. The DB2 Legacy CLI-based Type 2 driver is not supported for connectivity to DB2 UDB for iSeries.

In some cases, this driver works successfully for long periods of time. The problem occurs when WebSphere Application Server maintenance, such as when a fix pack or cumulative fix is applied.

The following exception is seen in the SystemOut.log file during the failure:

[4/29/04 16:15:45:777 KST] 3be00122 FreePool E J2CA0046E: Method cr
eateManagedConnectionWithMCWrapper caught an exception during creation
of the ManagedConnection for resource jdbc/myDataSource, throwing ResourceAllocationException. Original exception: java.lang.StringIndexOutOfBoundsException: String index out of range: 3
at java.lang.String.substring(String.java(Compiled Code))
at
com.ibm.websphere.rsadapter.DB2DataStoreHelper.doConnectionSetup(
DB2DataStoreHelper.java:235)
at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getConnection (WSRdbDataSource.java:673)

 
Resolving the problem
Use a supported JDBC driver.

To connect WebSphere Application Server v5.x to DB2 UDB for iSeries (AS/400), the following options exist. Refer to the following link for more details:

Vendor-specific data sources minimum required settings
http://publib.boulder.ibm.com/infocenter/ws51help/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/rdat_minreq.html

  1. DB2 UDB for iSeries Native Driver
    • This driver is built on top of the iSeries DB2 CLI native libraries.
    • Recommended only for local DB2 connections. Not recommended for remote access.

  2. IBM® Toolbox for Java™ JDBC driver
 
Related information
Vendor-specific data sources minimum required settings
IBM Toolbox for Java JDBC driver
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > DB Connections/Connection Pooling
Operating system(s): Windows
Software version: 5.0
Software edition:
Reference #: 1190688
IBM Group: Software Group
Modified date: Nov 17, 2004