1详细异常日志

9/11/04 17:36:09 ERROR base.SQLHelper: Data truncation: Truncated incorrect DOUBLE value: '-9370.3530-'
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: '-9370.3530-'
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3971)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2490)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
at

  

2 查了一下网上的讨论以及各种可能性

  A 数据库编码 所以,将编码由utf8改成utf8mb4。
  B 升级mysql 驱动 
  C  jdbc的连接配置,要开启useUnicode=true,并且要设置一个支持中文的编码,不需要跟mysql表的编码保持一致,只需要支持中文就行。例如characterEncoding=utf8
   D  mybatis 的问题,自己需要
mybtais是用 insert into select 语句时出现一个奇怪的问题,生成的SQL语句,在MYSQL客服端执行没有问题,但是使用mybatis框架时出现了:Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'N900' 错误,网上查找了半天最终解决,出现问题的原因 在select 中有where条件,mode字段类型为varchat, 在mybatis mapper 文件中 使用了如下方式 where mode = 1, 改为 where mode='1',问题解决,具体原因待研究。 
 
我都不是上面的情况 
 
3 最后 凭借的sql里面string类型的加上 ' (单引号) 解决问题,注意拼接的sql,也许直接在数据库执行没有问题,但是代码执行会有问题
  例如 update table set phone = '1511001010100' where name = 'xxxysdfdsf'
 
 
 
 

异常-Data truncation: Truncated incorrect DOUBLE value: '-9370.3530-'的更多相关文章

  1. Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'L

    1.错误叙述性说明 [ERROR:]2015-06-08 09:49:42,523 [异常拦截] org.hibernate.exception.DataException: error execut ...

  2. Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'L

    1.错误描述 [ERROR:]2015-06-08 09:49:42,523 [异常拦截] org.hibernate.exception.DataException: error executing ...

  3. Data truncation: Truncated incorrect DOUBLE value:

    在写sql查询语句queryRunner.update(connection,"update account set balance=? where name=?",account ...

  4. java.sql.SQLException: Data truncation: Truncated incorrect DOUBLE value

    mysql 报这个异常:java.sql.SQLException: Data truncation: Truncated incorrect DOUBLE value update 表名 set c ...

  5. Data truncation: Truncated incorrect DOUBLE value 解决方案

    1.情况限制 此处的错误解决方案只讨论: 在使用Mybatis时,传入数组且使用<foreach>标签时出现此种报错: 2.报错案例 mapper.java /** * @Descript ...

  6. Error updating database. Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'as3'

    执行更新时的出错信息 Whitelabel Error Page This application has no explicit mapping for /error, so you are see ...

  7. com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value:...

    在使用mybatis的@Update注解的时候,报了一个这样的错 ### Error updating database. Cause: com.mysql.jdbc.MysqlDataTruncat ...

  8. Data truncation: Truncated incorrect DOUBLE value错误的解决方案

    Data truncation: Truncated incorrect DOUBLE value错误的解决方案: 当在修改某条单位记录时,发生了Data truncation: Truncated ...

  9. Truncated incorrect DOUBLE value错误

    mysql报错:Truncated incorrect DOUBLE value sql的update语法错误eg: update Person set name = 'auhnayuiL' and ...

随机推荐

  1. 比特币nBits计算

    转载:比特币源码分析(二十二) - 挖矿和共识 https://blog.csdn.net/yzpbright/article/details/81231351 CalculateNextWorkRe ...

  2. Masonry问题

    1. Masonry的布局问题: 参考博客: https://github.com/huang303513/UILayoutOfiOS 2. Masonry的自适应行高问题: 参考博客:https:/ ...

  3. 4.1 python类的特殊成员,偏函数,线程安全,栈,flask上下文

    目录 一. Python 类的特殊成员(部分) 二. Python偏函数 1. 描述 2. 实例一: 取余函数 3. 实例二: 求三个数的和 三. 线程安全 1. 实例一: 无线程,消耗时间过长 2. ...

  4. Java工程师学习指南第3部分:Spring与SpringMVC源码解析

    本文整理了微信公众号[Java技术江湖]发表和转载过的Spring全家桶优质文章,想看到更多Java技术文章,就赶紧关注吧. 前后端分离,我怎么就选择了 Spring Boot + Vue 技术栈? ...

  5. 最新 4399java校招面经 (含整理过的面试题大全)

    从6月到10月,经过4个月努力和坚持,自己有幸拿到了网易雷火.京东.去哪儿.4399等10家互联网公司的校招Offer,因为某些自身原因最终选择了4399.6.7月主要是做系统复习.项目复盘.Leet ...

  6. redis的安装和连接

  7. luogu P1115 最大子段和 (dp)

    链接: https://www.luogu.org/problemnew/show/P1115 题面: 题目描述 给出一段序列,选出其中连续且非空的一段使得这段和最大. 输入输出格式 输入格式: 第一 ...

  8. 关于HTTP返回码

    301与302区别: 301 重定向 三种主流搜索引擎(Google, Bing, Yahoo)对待301都是一样的.它们忽略原始链接然后把重定向后的新链接加入索引.例如:如果用301把 http:/ ...

  9. CentOS7下使用Sonatype Nexus3搭建Docker私有仓库

    相关资料: Sonatype Nexus3官方网站:https://www.sonatype.com/download-oss-sonatype Sonatype Nexus3 Docker Hub地 ...

  10. 剑指offer29:最小的k个数

    1 题目描述 输入n个整数,找出其中最小的K个数.例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4个数字是1,2,3,4,. 2 思路和方法,C++核心代码 2.1 sort()函数,ve ...