Example and cracking of DB2 database error messages

Source: Internet
Author: User

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:

 
 
  1. com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -407, SQLSTATE: 23502, SQLERRMC: TBSPACEID=2, TABLEID=640, COLNO=0 
  2. at com.ibm.db2.jcc.b.ig.e(ig.java:1594)  
  3. at com.ibm.db2.jcc.b.ig.a(ig.java:1223)  
  4. at com.ibm.db2.jcc.c.gb.n(gb.java:718)  
  5. at com.ibm.db2.jcc.c.gb.i(gb.java:255)  
  6. at com.ibm.db2.jcc.c.gb.c(gb.java:53)  
  7. at com.ibm.db2.jcc.c.w.c(w.java:46)  
  8. at com.ibm.db2.jcc.c.vb.g(vb.java:151)  
  9. at com.ibm.db2.jcc.b.ig.p(ig.java:1218)  
  10. at com.ibm.db2.jcc.b.jg.d(jg.java:2340)  
  11. at com.ibm.db2.jcc.b.jg.W(jg.java:463)  
  12. at com.ibm.db2.jcc.b.jg.executeUpdate(jg.java:446)  
  13. 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.