- SQL Error: 1406, SQLState: 22001
- Data truncation: Data too long for column 'add_user' at row 1
- Could not synchronize database state with session
org.hibernate.exception.DataException: Could not execute JDBC batch update
Data truncation: Data too long for column 'add_user' at row 1
造成原因:保存数据的时候出错,网上搜索后了解到造成这错误的可能性有2种:1添加的内容长度大于数据库字段的内容,2由于编码格式导致字符串内容不符
解决1的方法:检验发送字段的长度和数据库字段的长度是否项目,我是因为id的varchar=20写错了,将其该回50后错误保存成功