PQ91121: JAVA.LANG.SQLEXCEPTION PARAMETER WITH INDEX 1 IS NOT SET OCCURS USING PREPARED STATEMENTS AND PREPARED STATEMENT CACHING ENABLED | |||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||
![]() APAR status Closed as program error. Error description Customer is using a DB2 JDBC driver and is getting error java.lang.sqlexception parameter with index 1 is not set. The customer verified the prepared statement and set methods were correct.Local fix A workaround for this problem is to disable Prepared Statement Caching, although this workaround does have performance implications.Problem summary **************************************************************** * USERS AFFECTED: All users of WebSphere Application Server * * V5.0 for z/OS * **************************************************************** * PROBLEM DESCRIPTION: SQLException with message "Parameter * * with index of 1 is not set." when using * * batch execution with Prepared * * Statements. The actual number of the * * index may vary. * **************************************************************** * RECOMMENDATION: * **************************************************************** When the executeBatch() method of a PreparedStatement object is called before using the addBatch() method to add the actual Statements that will be executed, WebSphere throws an SQLException indicating that a parameter is not set. Although the java.sql.PreparedStatement API is not clear as to what should be done, some JDBC drivers may allow this and treat it as a no-op. WebSphere's SQLException is preventing the driver specific behavior from taking effect. This problem can be seen as an SQLException in the joblog of the application servant region that looks similar to the following: SQLException(1): sqlcode=0 sqlstate=null message=Parameter with index of 1 is not set. com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement. enforceStatementProperties(WSJdbcPreparedStatement.javaProblem conclusion WebSphere's parameter tracking has been removed, so enforcement of parameter setting is now handled by the JDBC driver which may choose to treat a zero statement batch execution as a no-op. APAR PQ91121 is associated with SERVICE LEVEL W502014 of WebSphere Application Server V5.0 for z/OS.Temporary fix Comments
APAR is sysrouted FROM one or more of the following: PQ80774 APAR is sysrouted TO one or more of the following: Modules/Macros
Publications Referenced
|
Document Information |
Current web document: swg1PQ91121.html
Product categories: Software > Application Servers >
Distributed Application & Web Servers > WebSphere Application
Server for z/OS
Operating system(s):
Software version: 500
Software edition:
Reference #: PQ91121
IBM Group: Software Group
Modified date: Sep 3, 2004
(C) Copyright IBM Corporation 2000, 2009. All Rights Reserved.