报错信息
java.sql.BatchUpdateException: Incorrect string value: '\xF0\xA7\x9D\x81\xE6\xB5...' for column 'completion_content' at row 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.Util.getInstance(Util.java:408)
at com.mysql.jdbc.SQLError.createBatchUpdateException(SQLError.java:1163)
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1823)
at com.mysql.jdbc.PreparedStatement.executeBatchInternal(PreparedStatement.java:1307)
at com.mysql.jdbc.StatementImpl.executeBatch(StatementImpl.java:970)
at com.p6spy.engine.wrapper.StatementWrapper.executeBatch(StatementWrapper.java:97)
at com.alibaba.druid.filter.FilterChainImpl.statement_executeBatch(FilterChainImpl.java:3118)
at com.alibaba.druid.filter.FilterAdapter.statement_executeBatch(FilterAdapter.java:2507)
at com.alibaba.druid.filter.FilterEventAdapter.statement_executeBatch(FilterEventAdapter.java:279)
at com.alibaba.druid.filter.FilterChainImpl.statement_executeBatch(FilterChainImpl.java:3
原因是数据库表的编码集 CHARSET=utf8 汉字是三个字符,特殊的情况可能用4个字符‘’ 改为utf8mb4就好了
大佬文章详解 https://www.cnblogs.com/Neil223/p/15346052.html
|