错误:--- Cause: java.sql.SQLException: Incorrect string value: '\xE7\xAC\xAC\xE4\xB8\x89...' for column 'CE_NAME' at row 1
            at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:107)
            at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:393)
            at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
            at org.springframework.orm.ibatis.SqlMapClientTemplate$9.doInSqlMapClient(SqlMapClientTemplate.java:399)
            at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:209)
            ... 102 more

解决方案:

将数据库编码修改为utf8,mysql/my.ini的修改方式为:
[mysqld]
character-set-server=utf8
[mysql]
default-character-set=utf8

注意:不是utf-8,而是utf8
数据表修改:alter database db_name character set utf8 collate utf8_general_ci;

相关文章:

  • 2022-12-23
  • 2021-07-31
  • 2021-10-29
  • 2021-09-30
  • 2021-06-27
  • 2021-07-17
猜你喜欢
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2022-01-05
  • 2022-12-23
相关资源
相似解决方案