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

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 wechat
欢迎关注itzhai公众号,欢迎关注itzhai公众号,获取更多最新的文章