zoukankan      html  css  js  c++  java
  • MySql系列:中文写入数据库出现错误java.sql.SQLException: Incorrect string value: 'xE5xxxx' for column 'xxxx' at row 1及其解决方法

    在将kft-activiti-demo的数据库连接改为mysql之后,可以正常登陆,但是在新建请假流程的时候出现如下错误:
     
    Caused by: java.sql.SQLException: Incorrect string value: 'xE5x85xACxE4xBCx91' for column 'leave_type' at row 1
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:998)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2447)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2594)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1901)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2113)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2049)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2034)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:133)
    ... 122 more
     
    经过查找发发现是由于mysql连接设置的有问题,在application.properitis中设置的连接如下:
    jdbc.url=jdbc:mysql://localhost:3306/kafeitu?useUnicode=true&characterEncoding=utf-8 
     
    应该改为:
    jdbc.url=jdbc:mysql://localhost:3306/kafeitu?useUnicode=true&characterEncoding=utf-8
     



  • 相关阅读:
    poj1466
    vc剪贴板
    【转帖】BCGControlBar使用心得如何捕获Workspace bar类上的树控件的消息
    Windows API一日一练
    BCG 使用CBCGPToolbarFontSizeCombo 时下拉框无内容
    VB API教程 王国荣
    用API 现成的函数处理工程退出时的文件保存
    VC 剪贴板操作
    BCG中使用状态栏显示状态信息
    界面库
  • 原文地址:https://www.cnblogs.com/strinkbug/p/4901025.html
Copyright © 2011-2022 走看看