Tag Archives: DRIVER=4.17.29

APP Report DB2 SQL Error: SQLCODE=-302, SQLSTATE=22001, SQLERRMC=null, DRIVER=4.17.29

The application suddenly reports an error and keeps swiping the following error.

org.springframework.dao.DataIntegrityViolationException:

### Error querying database. Cause: com.ibm.db2.jcc.am.SqlDataException: DB2 SQL Error: SQLCODE=-302, SQLSTATE=22001, SQLERRMC=null, DRIVER

=3.64.96

### The error may exist in file [E:\mapper file path] (non-critical here, hidden)

### The error may involve defaultParameterMap

### The error occurred while setting parameters

### SQL: select * from XXX?(non-critical here, hidden)

### Cause: com.ibm.db2.jcc.am.SqlDataException: DB2 SQL Error: SQLCODE=-302, SQLSTATE=22001, SQLERRMC=null, DRIVER=3.64.96

; SQL []; DB2 SQL Error: SQLCODE=-302, SQLSTATE=22001, SQLERRMC=null, DRIVER=3.64.96; nested exception is com.ibm.db2.jcc.am.SqlDataExceptio

n: DB2 SQL Error: SQLCODE=-302, SQLSTATE=22001, SQLERRMC=null, DRIVER=3.64.96

at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101)

at

The above error report, the problem in the value of the note where the error, check the sql no exceptions, no major problems with the code, the length of the database fields is also nothing wrong.

Finally found one, set the environment variable DB2_DEFERRED_PREPARE_SEMANTICS=YES
http://book.51cto.com/art/201112/310691.htm

Problem solved