DB2 ERRORCODE=-4229, SQLSTATE=null

2019-02-23 04:03发布

问题:

I'm getting this error while executing a batch operation. Use getNextException() to retrieve the exceptions for specific batched elements.ERRORCODE=-4229, SQLSTATE=null

I'm not finding any pointer to proceed with debugging this error.

Appreciating any help!!!

回答1:

Search for the error on the IBM page:

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.db2z10.doc.java%2Fsrc%2Ftpc%2Fimjcc_rjvjcsqc.htm

-4229 Message text: text-from-getMessage Explanation: An error occurred during a batch execution.

User response: Call SQLException.getMessage to retrieve specific information about the problem.

So, it might be related to any underlying error during the execution of your batch insert/update/delete



回答2:

For those who are looking for an solution to this error.

For me this was due to

THE INSERT OR UPDATE VALUE OF FOREIGN KEY constraint-name IS INVALID. DB2 SQL Error: SQLCODE=-530, SQLSTATE=23503



回答3:

In my case, this occurred because I had an unique covering index defined on two columns and the combination of these two values was not unique when I was inserting the records.



标签: db2