com.mysql.jdbc.MysqlDataTruncation: Data truncation异常
Exception in thread "main" com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'note' at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2868)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1169)
at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:693)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1404)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1318)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1303)
at MyPrepare.main(MyPrepare.java:87)
原因:
第一,方法重载问题
第二,字符超过了长度
第三,就是编码问题(重要,容易被人忽略)
有两种可能,第一种就是数据库编码,另外一种数据库编码没问题,文件编码有问题
com.mysql.jdbc.MysqlDataTruncation: Data truncation异常的更多相关文章
- 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 ...
- 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 ...
- mysql 插入中文报错: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value...
总结写在前面, 总结: 当Java通过jdbc链接mysql插入中文时,要保证程序可以正常执行,而且插入的中文不会乱码, mysql服务器端,对数据表(不是数据库)的编码设置,要保证是支持中文的,例如 ...
- Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'content' a
1.错误描述 org.hibernate.exception.DataException: could not execute statement at org.hibernate.exception ...
- 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 ...
- Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'img' at row 1故障
Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'img' at ro ...
- 数据库报错com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'ua' at row 1
记一次报错记录,成长路上的点滴 明明使用浏览器或者微信开发工具调试接口没有问题,但是在真机测试时候就出问题了.(((¬_¬)) 500服务器内部错误,要死的节奏啊 登陆tomcat服务器 使用命令ta ...
- com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value:...
在使用mybatis的@Update注解的时候,报了一个这样的错 ### Error updating database. Cause: com.mysql.jdbc.MysqlDataTruncat ...
- com.mysql.jdbc.MysqlDataTruncation:Data Truncation:Data too long for column '字段name' at row 1
1.问题描述: 在mysql插入数据的时候报错:Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long fo ...
随机推荐
- redis生成分布式id方案
分布式Id - redis方式 本篇分享内容是关于生成分布式Id的其中之一方案,除了redis方案之外还有如:数据库,雪花算法,mogodb(object_id也是数据库)等方案,对于redis来 ...
- http://www.cnblogs.com/xdp-gacl/p/4200090.html
孤傲苍狼 只为成功找方法,不为失败找借口! JavaWeb学习总结(五十)——文件上传和下载 在Web应用系统开发中,文件上传和下载功能是非常常用的功能,今天来讲一下JavaWeb中的文件上传和下载功 ...
- Linux学习笔记之grep命令和使用正则表达式
0x00 正则表达式概述 正则表达式是描述一些字符串的模式,是由一些元字符和字符组成的字符串,而这些元字符是一些表示特殊意义的字符,即被正则表达式引擎表达的字符表示与其本意不同的一些字符. 0x01 ...
- 浅谈maven setting.xml 设置的mirrorof标签作用。
https://blog.csdn.net/whbing1471/article/details/53983779 A 看这一段 背景:写好的java项目放置到linux服务器上进行编辑的时候,由于m ...
- 关于C#对Xml数据解析
首先进行简单说明Xml 与Html 和 XAML数据标签的差别. 1.Xml属于数据文本, 被设计为传输和存储数据,其焦点是数据的内容.它与json格式数据相似,可作为服务数据传输类型. 其中XML ...
- Neo私钥到地址
基础名词 Neo是个区块链工程,地址,公钥,私钥,地址脚本,base58,sha256,ripemd160,ECCsa,secp256k1,secp25r1这些词都是区块链技术相关的,或是新东西或者有 ...
- Ubuntu 使用scrapy-splash
配置docker 1.更新apt索引: $ sudo apt-get update 2.安装包允许apt通过HTTPS使用仓库: sudo dpkg --configure -a sudo apt ...
- "startIWDP": true
{ "platformName": "iOS", "platformVersion": "11.0", "au ...
- 2019-08-01 Ajax实现从数据库读取表
php代码 <?php //用pdo连接数据库 $dsn = 'mysql:host=127.0.0.1;port=3306;charset=utf8;dbname=news'; //实例化PD ...
- Jest单元测试进阶
Jest 命令行窗口中的指令 在学习Jest单元测试入门的时候,给Jest命令提供了一个参数 --watchAll, 让它监听测试文件或测试文件引入的文件的变化,从而时时进行测试.但这样做也带来一个问 ...