We’ve got an application using spring for making calls to DB2 stored procedures.
The application was working fine with jdbc version 1.XX.XX (and DB2 V8). An recent upgrade to DB2 V9 moves us to using jdbc versiong 3.58.90 instead.
However, this seems to have broken the named parameters mapping in spring (version 2.5.5). Some previously working code had call string
call storedproc123(:id,:date)
now throws exceptions with
[jcc][t4][10427][12544][3.58.90] Error parsing FLOAT literal value starting at index 19. Error Detail:Unexpected character ':' found in FLOAT literal.
...
ERRORCODE=-4463, SQLSTATE=42601
...
Has anyone encountered something similar?
Thanks in advance!
—edited to add more info—
I’ve tried swapping the old jdbc back after the upgrade. The application works just fine with the old driver, however we’d like to upgrade to the newer version since another app on the same server needs this newer jdbc, and it’s difficult to have different versions of the same jdbc deployed on our server (we uses JBoss).
http://redneckprogrammer.blogspot.com/2009/10/running-multiple-versions-of-oracle.html discussed how to deploy multiple versions of the same JDBC driver, however this seems to be too much of a hack and I’d like to avoid it if at all possible.
Found the cause, see IBM patch PK87567 .
…
All Connectivity: Driver code has been enhanced to support
a new API on com.ibm.db2.jcc.DB2ParameterMetaData:
getParameterMarkerNames, which returns a list of parameter
marker names used in the SQL Statement as a String .
This method returns null if property
enableNamedParameterMarkers is set to
DB2BaseDataSource.NOT_SET or DB2BaseDataSource.NO, or if
there are no named parameter markers in the SQL Statement.
The list returned contains unique parameter marker names.
If a named parameter marker appears more than once in the
SQL Statement, it will only appear once in the list
returned. (120191)
…
Fixed the problem by enabling the marker.