IBM Support

DB2 error (DSRA0010E: SQL State = 07006, Error Code = -301) when using DB2 Universal JDBC Driver (db2jcc.jar) with Entity Bean



In EJB development, when using the IBM DB2 Universal JDBC Driver (db2jcc.jar), a call stack error occurs that does not happen when using the DB2 Legacy CLI-based Type 2 JDBC Driver (



[9/6/05 10:27:10:598 EDT] 00000038 DataAccessReq E   PMGR0000E: Call stack: PMGR6022E: Error using adapter to create or execute an Interaction.
at Source)
Caused by: java.sql.SQLException: The value of input host variable or parameter number "1" cannot be used because of its data type.DSRA0010E: SQL State = 07006, Error Code = -301


This error might result if an EJB attribute of type byte array([]) is mapped to a CHARACTER FOR BIT DATA or VARCHAR FOR BIT DATA field.

By default, the deferPrepares Custom Property of the DB2 data source is set to true which, in this case, causes the error.

Resolving The Problem

Use the explicit data type conversion for input parameters, as the generated code is using it. This can be accomplished by setting the Custom Property deferPrepares on the data source to false.

To change this property on the data source, use the administrative console for the version 6 WebSphere Test Environment or a stand-alone WebSphere Application Server.

For the version 5.x WebSphere Test Environment use the Server Configuration Editor provided by Rational Application Developer to set this value on the data source.

For more details regarding the differences between the DB2 Universal JDBC Driver and other DB2 JDBC drivers please see the URL in the Related Information section below.

[{"Product":{"code":"SSRTLW","label":"Rational Application Developer for WebSphere Software"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"EJB Development","Platform":[{"code":"PF033","label":"Windows"},{"code":"PF016","label":"Linux"}],"Version":"6.0;;","Edition":"","Line of Business":{"code":"LOB15","label":"Integration"}},{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"DB Connections\/Connection Pooling","Platform":[{"code":"","label":"Multi-Platform"}],"Version":"5.0;5.0.1;5.0.2;;;;;;;;;;;;;;5.1;;;;;;;5.1.1;;;;;;;6.0;;;6.0.1;;;6.0.2;;","Edition":"Advanced;Base;Enterprise","Line of Business":{"code":"LOB15","label":"Integration"}},{"Product":{"code":"SSBRLP","label":"WebSphere Studio Application Developer"},"Business Unit":{"code":"BU050","label":"BU NOT IDENTIFIED"},"Component":"Server","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"5.1.2","Edition":"All Editions","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
16 June 2018