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. Pandas与Matplotlib结合进行可视化

    前面所介绍的都是以表格的形式中展现数据, 下面将介绍Pandas与Matplotlib配合绘制出折线图, 散点图, 饼图, 柱形图, 直方图等五大基本图形. Matplotlib是python中的一个 ...

  2. 跨域跨域跨域,从此say goodbye

    跨域这个问题每个开发者都会遇到,只是时间先后而已,你不搞清楚它他就像狗皮膏药一样粘着你,在你求职生涯中不停的遇到,然后你每次都要做这个功课,终于有一天这个名词已经让我忍无可忍了,下定决心必须搞定它,要 ...

  3. sort(()=>{return Math.random()-0.5)}乱序数组不准确

    为什么sort(()=>{return Math.random()-0.5)}乱序数组不准确.(注意结合插入排序原理来理解) @1.chrome浏览器对于数组长度10以内为插入排序.反之则快速排 ...

  4. python 1秒启动一个下载服务器

    在Linux系统中,进入要下载文件的目录,用python执行以下命令.启动一个简单的文件下载服务器. python2: [root@saltstack-1 apps]# python -m Simpl ...

  5. [转帖]ECC公钥格式详解

    ECC公钥格式详解 https://www.cnblogs.com/xinzhao/p/8963724.html 本文首先介绍公钥格式相关的若干概念/技术,随后以示例的方式剖析DER格式的ECC公钥, ...

  6. ESXi 虚拟机 提示 无法打开本地虚拟机的 xxx.vmx 的本地管道的 问题解决.

    1. 今天同事与我联系, 说一个虚拟机出现连不上, vcenter控制台关闭虚拟机之后 再次打开报错: 2. 自己最开始的解决方法 移除虚拟机, 进入服务器的datastore 重新注册, 结果发现问 ...

  7. Windows Eclipse Scala的入门HelloWorld

    [学习笔记] Windows Eclipse Scala的入门HelloWorld 有关带scala版本的eclipse4.7的下载, 你可以直接去: http://scala-ide.org/dow ...

  8. (二十三)Dbutils 工具介绍

    目录 Dbutils简介 API 介绍 Dbutils 已实现的结果集处理器 : Dbutils简介 commons-dbutis 是Apache 组织提供的一个开源JDBC工具类库,它对JDBC进行 ...

  9. 线段树维护动态连续子段HDU1540

    题意:http://acm.hdu.edu.cn/showproblem.php?pid=1540 #define IOS ios_base::sync_with_stdio(0); cin.tie( ...

  10. opencv实现人脸识别(二) 人脸图像采集模块

    这一步我们开始搭建第一个模块,用来检测到图像中的人脸位置,并将它拍下来保存在指定路径 流程图: 代码实现: import cv2 def pic(cam): # 调用笔记本内置摄像头,所以参数为0,如 ...