mysql 保存手机输入法的数据报错org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback
来源:互联网 发布:淘宝包邮自动关闭订单 编辑:程序博客网 时间:2024/05/10 17:13
org.springframework.jdbc.UncategorizedSQLException:
PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO es_gs_WeiXinAuthorize (id, nick_name, privilege, unionid, access_token_json, openid, code, headimgurl, access_token, member_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; SQL state [HY000]; error code [1366]; Incorrect string value: '\xF0\x9F\x8C\xB9' for column 'nick_name' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xF0\x9F\x8C\xB9' for column 'nick_name' at row 1
出现这种异常首先是数据库的字符集问题 要把字符集设置成 utf8_general_ci
SHOW FULL COLUMNS FROM table 查看字符集是什么类型的
CREATE TABLE `es_gs_weixinauthorize` (
`id` varchar(55) NOT NULL DEFAULT '' COMMENT 'id',
`nick_name` varchar(255) NOT NULL COMMENT '微信用户名称',
) ENGINE=InnoDB DEFAULT charset utf8 collate utf8_general_ci;
之所以出现数据库无端报错是因为 utf8字符MaxLen=3,但是某些unicode字符转成utf8编码之后有4个字节 所以就报错了
网上说设置utf8mb4 这些都是不行的
- mysql 保存手机输入法的数据报错org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback
- spring更新clob报错:org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL
- org.springframework.jdbc.UncategorizedSQLException
- org.springframework.jdbc.UncategorizedSQLException
- org.springframework.jdbc.UncategorizedSQLException:
- org.springframework.jdbc.UncategorizedSQLException:
- org.springframework.jdbc.UncategorizedSQLException
- org.springframework.jdbc.UncategorizedSQLException
- Ibatis 报:org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized S
- 异常org.springframework.jdbc.UncategorizedSQLException: Hibernate operation
- org.springframework.jdbc.UncategorizedSQLException 错误解决
- org.springframework.jdbc.UncategorizedSQLException: 不允许从数据类型 varbinary 到 date 的隐式转换
- org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLExcepti
- org.springframework.jdbc.UncategorizedSQLException: Error setting null parameter.
- org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for
- Already value org.springframework.jdbc.datasource.ConnectionHolder报错
- spring连mysql报错org.springframework.dao.RecoverableDataAccessException
- 【报错】org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBinding
- Linux 忘记root密码
- 单源多点最短路径-Dijkstra算法
- 关于微信安卓版计步作弊器
- view 使用 setTag() 和getTag方法
- java之继承,封装,多肽
- mysql 保存手机输入法的数据报错org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback
- Cocos2d-Html5--打怪升级之路
- 第83课:使用Scala和Java两种方式实战Spark Streaming开发 本地webui小技巧
- Android API Guides---Pickers
- Linux环境下搭建VSFTP服务器
- first root
- pandas学习笔记
- download and install the jdk1.8 on ubuntu14.4
- 扩展Lucas定理