Caused by: java.sql.BatchUpdateException: Data truncation: Data too long for column 'JLFSM' at row 1

来源:互联网 发布:易语言软件破解 编辑:程序博客网 时间:2024/05/13 20:02
Caused by: java.sql.BatchUpdateException: Data truncation: Data too long for column 'JLFSM' at row 1
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2018)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1454)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)

... 131 more


今天在添加的时候遇到这个错误,原因是在添加数据的时候,

添加的字段或者内容与数据库的字段不相符,请认真检查数据库的字段与添加或修改的字段是否一样

提供解决方法:

1:修改该的长度:alter table test modify column JLFSM varchar(130);  ,之前我的长度是1,现在增大,已解决

  2:修改类型: alter table test  modify columnJLFSM  char(30);  修改类型


请认真检查:数据库、库表、字段的字符集设置成一致。

阅读全文
0 0
原创粉丝点击