`

Data truncation: Out of range value

阅读更多

遇到一个奇怪的错误

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value for column 'userId' at row 1
	com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3374)
	com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3308)
	com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1837)
	com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961)
	com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2543)
	com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1737)
	com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2022)
	com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1940)
	com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1925)
	org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
	org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)

 

然后追溯到sql语句

insert 
        into
            t_access_log
            (access_day, access_daytime, access_type, description, device_id, device_type, extranet_ip, 
ip, operate_result, os_type, query_string, request_target, requestURI, reserved, session2_id, time, user_agent, userId, username) 
        values
            ('2016-03-18', '2016-03-18 20:23:03', '1', '手机端视频列表', null, null, '127.0.0.1', '127.0.0.1',
 '总条数:756', null, null, 'video:json', '/video/json', NULL, 'E065035A48A191F7DA5BA312E0112705', 1458303783, 
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36', -1, null);

 执行结果:

[SQL]insert 

        into

            t_access_log

            (access_day, access_daytime, access_type, description, device_id, device_type, extranet_ip, 

ip, operate_result, os_type, query_string, request_target, requestURI, reserved, session2_id, time, user_agent, userId, username) 

        values

            ('2016-03-18', '2016-03-18 20:23:03', '1', '手机端视频列表', null, null, '127.0.0.1', '127.0.0.1',

 '总条数:756', null, null, 'video:json', '/video/json', NULL, 'E065035A48A191F7DA5BA312E0112705', 1458303783, 

'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36', -1, null);

[Err] 1264 - Out of range value for column 'userId' at row 1

 

看看userId的类型,终于找到了原因

 

userId的类型是正整数,所以报错了

 

 

  • 大小: 89.3 KB
分享到:
评论

相关推荐

    MySQL中字符串与Num类型拼接报错的解决方法

    发现问题 图片地址如下 ...需要实现的效果是要加上尺寸,如以下效果 ...一开始想当然使用 UPDATE tag_group SET cover = cover + '|...Data truncation: Truncated incorrect DOUBLE value: ‘http://huoche.7234.cn/im

    java中常见的错误.docx

    3. 数据类型不匹配:当尝试将不兼容的数据类型插入到数据库中时,如`Data truncated for column 'gatheringMoney' at row 1`和`Data truncation: Out of range value adjusted for column 'amount' at row 14`,表明...

    mysql插入数据中文报错问题,最全解决方式

    然而,在实际操作中可能会遇到中文字符无法正常插入数据库的问题,通常表现为错误提示“Incorrect string value”等。本文将详细探讨这一问题的原因,并提供一系列解决方案。 #### 错误现象描述 当尝试向MySQL...

    Data Truncation(亲测可用).md

    Data Truncation(亲测可用).md

    strings-truncation:用全角字符和ANSI代码截断字符串

    字符串::截断 使用全角字符和ANSI代码截断字符串。 特征 没有猴子修补String类 ... strings = Strings :: Truncation . new strings . truncate ( "I try all things, I achieve what I can." ) # => "I try all thing

    truncation:这个程序截断一个给定的数字-matlab开发

    在MATLAB编程环境中,`truncation`是一个常见的数学操作,用于处理浮点数,将它们转换为整数或者按照指定精度进行截断。在给定的标题和描述中,我们关注的是一个特定的MATLAB函数,即`truncate`,它用于截断一个给定...

    truncation:多边形的截断

    在IT领域,尤其是在Web开发中,SVG(Scalable Vector Graphics)是一种常用的技术,用于创建矢量图形。本文将深入探讨“截断”这一概念,特别是在多边形处理中的应用,以及如何使用React来实现SVG图标的构建。...

    ngx-line-truncation:角线截断解决方案。 通过给定的行号截断文本块,并在末尾添加省略号

    NGX线截断Ngx Line Truncation是Angular的行截断实现,可通过用户定义的行号截断文本。 () 除行截断外,此软件包还进行了一些性能优化,不仅提高了可用性,而且还提高了Angular平台的可靠性。 它使用重试逻辑来...

    MySQL关于sql_mode解析与设置讲解

    昨晚在往MySQL数据库中插入一组数据时,出错了!数据库无情了给我报了个错误:ERROR 1365(22012):Division by 0;意思是说:你不可以往数据库中插入一个 除数为0的运算的结果。于是乎去谷歌了一番,总算是明白了...

    sql server导入oracle数据库.rar

    3. **导入到Oracle**:Oracle提供了多种导入工具,如SQL*Loader、Data Pump(expdp/impdp)和SQL Developer。SQL*Loader适合处理大量数据,Data Pump则用于大规模的数据迁移。SQL Developer是一款图形界面工具,适合...

    Missing and Modified Data in Nonparametric Estimation with R

    Ten chapters of the book cover basic cases of direct data, biased data, nondestructive and destructive missing, survival data modified by truncation and censoring, missing survival data, stationary ...

    Image compression using modified block truncation coding

    图像编码,this paper presents a modified block truncation coding(BTC) algorithm for image compression.Similar block in an image are mergrd intoa cluster and represented with the cluster center.

    Essential C

    The guide covers a wide range of topics, including basic data types, operators, control structures, complex data types, functions, and advanced concepts such as pointers and heap memory management. ...

    Mysql中文乱码问题完美解决方案.docx

    - `com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column` 错误表示数据长度超过了列的允许长度,这通常不是字符集问题,而是字段长度不足。需检查对应列的定义并调整其大小。 7. **...

    Keil的常见编译警告

    7. warning: #69-D:integer conversion resulted in truncation 这个警告信息表示整数转换导致数据截断。这种情况下,可能造成数据丢失,出现错误。解决方法是关于这种警告,应该详细考虑。确定转换都在预期的结果...

    ADOL-C a package for the automatic differentiation of algorithms written in C C++

    free of truncation errors at a small multiple of the run-time and randomly accessed memory of the given function evaluation program. Derivative matrices are obtained by columns or rows. For solution ...

    Survival Analysis_Techniques for Censored and Truncated Data_Book

    **截尾(Truncation)** 是指观测过程中的某些部分完全被排除在外,因此不会出现在样本中。例如,在研究中只考虑存活超过一定时间的个体,这就会导致数据集中的左截尾。相反,如果只考虑在特定时间内死亡的个体,则会...

    Oracle sqldeveloper without jdk (win+linux)

    - Bug 5085334: If a numeric value is opened for editing in the Data tab for the first time after the table is refreshed, the decimal separator will always become dot, irrespective of the locale ...

    Applied Numerical Methods with MATLAB for Engineers and Scientists

    Chapter 4 Roundoff and Truncation Errors Part Two: Roots and Optimization Chapter 5 Roots: Bracketing Methods Chapter 6 Roots: Open Methods Chapter 7 Optimization Part Three: Linear Systems Chapter ...

Global site tag (gtag.js) - Google Analytics