Caused by java.sql.BatchUpdateException Data too long for column 'type_visible' at row 1

发布于 2011-07-28 | 更新于 2020-09-20

1191 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Data too long for column ‘type_visible’ at row 1
1191 [main] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session
org.hibernate.exception.DataException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:100)

Caused by: java.sql.BatchUpdateException: Data too long for column ‘type_visible’ at row 1
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1540)

The property type_visible is boolean,and change into BIT(1) after mapping into MySQL. The fact is that it can’t transforming boolean into BIT(1).So it prompt “Data too long for column ‘type_visible’ at row 1”. I was using the last version of mysql,but still using a connector driver of old version.In order to solve this problem, I use mysql-connector-java-3.1.13-bin.jar instead of mysql-connector-java-3.0.17-bin.jar.Then it works.

本文作者: arthinking

本文链接: https://www.itzhai.comcaused-by-java-sql-batchupdateexception-data-too-long-for-column-type-visible-at-row-1.html

版权声明: 版权归作者所有,未经许可不得转载,侵权必究!联系作者请加公众号。

×
IT宅

关注公众号及时获取网站内容更新。