数据库 MySQL 报错 could not execute batch
报错日志如下所示:
16:59:48 Thread-45 ERROR [standard] could not execute batch
com.fr.third.org.hibernate.exception.GenericJDBCException: could not execute batch
Caused by: java.sql.SQLException:Incorrect string value: '\xE6\xA8\xA1\xE6\x9D\xBF...' for column 'id' at row 1
==========
原因分析:
检查确保是有权限的
Incorrect string value: '\xE6\xA8\xA1\xE6\x9D\xBF...' for column 'id' at row 1应当是数据库编码的原因。
==========
解决方案:
查看客户建 FineDB 数据库的语句:create database finedb
发现没有加约束条件,将语句改为:create database finedb DEFAULT CHARSET utf8 COLLATE utf8_bin