zoukankan      html  css  js  c++  java
  • com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: '张三'异常的解决办法

    com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: '张三'异常的解决办法

    错误:

     com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: '张三'
      at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:104)
      at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:955)
      at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1094)
      at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1042)
      at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1345)
      at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1027)
        ..........................................

    解决方法:查看sql语句,注意更新操作的各个字段之间不能用and连接,而应当是用“  ,”连接

    错误示范:

     update student set stu_name=? and stu_sex=? and stu_age=? and stu_tel=? where stu_id=?

    正确示范:

     update student set stu_name=?,stu_sex=?, stu_age=? , stu_tel=? where stu_id=?

     

  • 相关阅读:
    SAP系统报错
    基金投资
    Reading: 重构相关
    C/C++: static variables
    C/C++: 如何删除本地文件/读取某个目录下符合某种pattern的所有文件路径
    如何在Linux下建立包含lua vm的unit test framwork
    C++实现字符串分割(类似于Python的split方法)
    postMan 汉化
    搞懂MySQL InnoDB事务ACID实现原理
    mysql 索引优化
  • 原文地址:https://www.cnblogs.com/nieaojie625/p/13088640.html
Copyright © 2011-2022 走看看