The following articles mainly describe the DB2 database error information, which is often used in actual applications and will cause a lot of inconvenience in actual operation, the following is an example of a DB2 database error message. The following describes the main content of the article.
Database
After a few days, I almost collapsed.
DB2 database error message:
- com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -407, SQLSTATE: 23502, SQLERRMC: TBSPACEID=2, TABLEID=640, COLNO=0
- at com.ibm.db2.jcc.b.ig.e(ig.java:1594)
- at com.ibm.db2.jcc.b.ig.a(ig.java:1223)
- at com.ibm.db2.jcc.c.gb.n(gb.java:718)
- at com.ibm.db2.jcc.c.gb.i(gb.java:255)
- at com.ibm.db2.jcc.c.gb.c(gb.java:53)
- at com.ibm.db2.jcc.c.w.c(w.java:46)
- at com.ibm.db2.jcc.c.vb.g(vb.java:151)
- at com.ibm.db2.jcc.b.ig.p(ig.java:1218)
- at com.ibm.db2.jcc.b.jg.d(jg.java:2340)
- at com.ibm.db2.jcc.b.jg.W(jg.java:463)
- at com.ibm.db2.jcc.b.jg.executeUpdate(jg.java:446)
- at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1968)
Solution:
Description of DB2 database error information: SQLSTATE: 23502 the insert or update value is null, but this column cannot contain null values.
SQLERRMC: TBSPACEID = 2, TABLEID = 640, COLNO = 0: an internal table is hidden in the DB2 database, which stores tables of the database exclusively, select * from syscat. tables where tableid = 640; Note: TBSPACEID, TABLEID, and COLNO are all fields in tables.
Set the auto-incrementing primary key in the queried table. Set the auto-increment attribute to "native" in the configuration file of hibernate ". Solve this problem.
The above content is an introduction to the error information of the DB2 database. I hope you will find some gains.