执行:@Test
public void testUpdate() {
Person person = personService.getPerson(1);
person.setName("小丽");
personService.update(person);
}
报错:
org.springframework.jdbc.UncategorizedSQLException: Hibernate flushing: Could not execute JDBC batch update; uncategorized SQLException for SQL [update Person set name=? where id=?]; SQL state [HY000]; error code [1366]; Incorrect string value: '\xE5\xB0\x8F\xE4\xB8\xBD' for column 'name' at row 1; nested exception is java.sql.BatchUpdateException: Incorrect string value: '\xE5\xB0\x8F\xE4\xB8\xBD' for column 'name' at row 1编码都是采用UTF-8 怎么无法插入中文
public void testUpdate() {
Person person = personService.getPerson(1);
person.setName("小丽");
personService.update(person);
}
报错:
org.springframework.jdbc.UncategorizedSQLException: Hibernate flushing: Could not execute JDBC batch update; uncategorized SQLException for SQL [update Person set name=? where id=?]; SQL state [HY000]; error code [1366]; Incorrect string value: '\xE5\xB0\x8F\xE4\xB8\xBD' for column 'name' at row 1; nested exception is java.sql.BatchUpdateException: Incorrect string value: '\xE5\xB0\x8F\xE4\xB8\xBD' for column 'name' at row 1编码都是采用UTF-8 怎么无法插入中文
解决方案 »
- 配置init_connect='SET autocommit=0',是否对slave同步操作也生效?
- 大神赐教,运行出错
- 已知A表,怎么生成B表,用sql语句实现?跪求!!!
- 连接mysql时出现错误,在线等!!急急急!!
- 关于MYSQL导入TXT文本的问题在线求助!
- 这个表是否需要加上索引
- mysql 表类型innodb的重大bug
- "19971215235026"这个值如何在php程序中得到!!
- 为什么我的MysqlGUI无法连接服务器????
- mysql 服务器(IO)压力突然增大,并且一直持续,说明你的解决方案
- Mac OS 下Navicat 导入导出sql闪退的问题
- mysql存储过程
SET names gbk;