Cause: java.sql.BatchUpdateException: Unknown column ‘xxx‘ in ‘field list‘

Error 12164 – [xnio-1 TASK-2] p.p.c.s.c.globalexception handler resolver: Global exception information ex = com.xxx.cd.mapper.cdinvoiceinfomapper.insert (batch index # 1) failed———— Error information

Cause: java.sql.batchupdateexception: unknown column ‘xxx’ in ‘field list’ — prompt reason

Finding problems

First of all, the error prompt means that the field cannot be found in the database and the input is invalid

resolvent

    first check the database to see if there is this field in the table. If not, add it. Then add this field to the corresponding mapper.xml and entity class. If the above problems do not exist or cannot be solved, it is recommended to check on the web side to see if there is this missing data in your input data. If not, check the service layer, Open the configuration in Nacos, maintain the table directory in this field, and find that there is this table, but this table does not need this field. Remove this table from it, and then you can do it

Summary

Don’t be afraid when you make mistakes. It’s best to read the error information and the reason patiently, and understand the meaning roughly. If you don’t understand, ask your colleagues first.

Read More: