We have a JAVA application which uses following
Database product name : DB2
Database product version : DSN07012
JDBC driver name : IBM DB2 JDBC Universal Driver Architecture
JDBC driver version : 2.3.63
APplication Server:Webspher e
When the prepared statement cache for the JDBC driver is set to > 0 following query fails on DB2 OS/390 version but doesn't fail on the UDB version on Windows. Any ideas.
Error:
: SQL Error Code = -99999 : MESSAGE = PreparedStateme nt: setNull method setting a non-nullable input parameter 1 to null.
Query is a : SELECT COUNTY FROM SYS_COUNTY where STATE_PROV_ID = ?
the parameter meter "?" is a state Id which happens to be passed in as "null" at runtime and which is being set using setBigDecimal() call to the prepared statement. STATE_PROV_ID in SYS_COUNTY table is defined as a NUMERIC(15), NOT NULL column. The error message makes perfectly sense but the problem is that we have no way to find all the places where the parameters values are nulls at runtime and fix the code.
Is this bug in driver or bug in our code? It appears that IBM remove same limitation from SQLJ from JDBC 2.3.72 version but they didn't specify anything for JDBC , Type 4 access.
Any Ideas?
- Anil
Database product name : DB2
Database product version : DSN07012
JDBC driver name : IBM DB2 JDBC Universal Driver Architecture
JDBC driver version : 2.3.63
APplication Server:Webspher e
When the prepared statement cache for the JDBC driver is set to > 0 following query fails on DB2 OS/390 version but doesn't fail on the UDB version on Windows. Any ideas.
Error:
: SQL Error Code = -99999 : MESSAGE = PreparedStateme nt: setNull method setting a non-nullable input parameter 1 to null.
Query is a : SELECT COUNTY FROM SYS_COUNTY where STATE_PROV_ID = ?
the parameter meter "?" is a state Id which happens to be passed in as "null" at runtime and which is being set using setBigDecimal() call to the prepared statement. STATE_PROV_ID in SYS_COUNTY table is defined as a NUMERIC(15), NOT NULL column. The error message makes perfectly sense but the problem is that we have no way to find all the places where the parameters values are nulls at runtime and fix the code.
Is this bug in driver or bug in our code? It appears that IBM remove same limitation from SQLJ from JDBC 2.3.72 version but they didn't specify anything for JDBC , Type 4 access.
Any Ideas?
- Anil
Comment