Mybatis出现:无效的列类型: 1111 错误
在使用Mybatis时,不同的xml配置文件,有的会提示:无效的列类型: 1111
比如这个sql:
update base.sys_person t
set t.rybh=#{rybh},t.xm=#{xm},t.ryzt=#{ryzt},t.sfzhm=#{sfzhm},t.xb=#{xb},t.sj=#{sj},t.yx=#{yx},t.jtzz=#{jtzz},t.bz=#{bz},t.csrq=#{csrq}
where t.ryid=#{ryid}
在csrq有值时不会报错,csrq为空时会报上述错误:
原因时什么呢?官方文档显示:

这句话的意思是,如果对一个属性字段,需要传递null值,(尤其是Date,int等类型时),JDBCType是必要的。(我觉得为了不出错,每个字段都写也是可以的)。
那好,根据上述文字修改:
update base.sys_person t
set t.rybh=#{rybh},t.xm=#{xm},t.ryzt=#{ryzt},t.sfzhm=#{sfzhm},t.xb=#{xb},t.sj=#{sj},t.yx=#{yx},t.jtzz=#{jtzz},t.bz=#{bz},t.csrq=#{csrq,jdbcType=TIMESTAMP}
where t.ryid=#{ryid}
问题解决。
Mybatis出现:无效的列类型: 1111 错误的更多相关文章
- [转]Mybatis出现:无效的列类型: 1111 错误
原文地址:http://www.cnblogs.com/sdjnzqr/p/4304874.html 在使用Mybatis时,不同的xml配置文件,有的会提示:无效的列类型: 1111 比如这个sql ...
- 【错误笔记】MyBatis SQLException: 无效的列类型: 1111
问题描述: org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #1 with J ...
- Java.sql.SQLException: 无效的列类型: 1111
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: ...
- oracle: jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型: 1111
https://www.cnblogs.com/mmlw/p/5808072.html org.mybatis.spring.MyBatisSystemException: nested except ...
- 报错:无效的列类型: 1111;must be specified for all nullable parameters.
org.springframework.jdbc.UncategorizedSQLException: Error setting null parameter. Most JDBC drivers ...
- mybatis出现无效的列类型
package com.webapp.hanqi.test; import java.util.Date; import org.junit.jupiter.api.AfterEach; import ...
- MYBATIS 无效的列类型: 1111
查询的时候竟然也会报错,如果参数是数字,需要加上jdbcType 在xml中加上 t.chart_id = #{chartId,jdbcType=DECIMAL}
- uncategorized SQLException for SQL []; SQL state [99999]; error code [17004]; 无效的列类型: 1111; nested exception is java.sql.SQLException: 无效的列类型: 1111
WHERE 的条件取值时添加上jdbcType=NUMBER这样的配置 参考[1]:https://blog.csdn.net/fyhjuyol/article/details/45483167
- Mybatis:使用bean传值,当传入值为Null时,提示“无效的列类型”的解决办法
问题描述:在使用mybatis对数据库执行更新操作时,parameterType为某个具体的bean,而bean中传入的参数为null时,抛出异常如下:org.mybatis.spring.MyBat ...
随机推荐
- [转]ionic Accordion list three levels
简化后的主要代码: $scope.groups = []; for (var i = 0; i < 2; i++) { $scope.groups[i] = { name: i, items: ...
- leetcode_401_Binary Watch_回溯法_java实现
题目: A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bot ...
- 怎样绘制ZBrush中的纹理
利用ZBrush的内置插件“投影大师”和“Polypainting”纹理贴图能够快速实现纹理的绘制.本文将对这两种方法的应用流程做一个介绍. 查看跟多内容请直接前往:http://www.zbrush ...
- 2014 Super Training #1 F Passage 概率DP
原题: HDU 3366 http://acm.hdu.edu.cn/showproblem.php?pid=3366 本来用贪心去做,怎么都WA,后来看网上原来是一个DP题. 首先按P/Q来做排 ...
- HDU 1085 Holding Bin-Laden Captive --生成函数第一题
生成函数题. 题意:有币值1,2,5的硬币若干,问你最小的不能组成的币值为多少. 解法:写出生成函数: 然后求每项的系数即可. 因为三种硬币最多1000枚,1*1000+2*1000+5*1000=8 ...
- Fix "Missing Scripts"
一.Missing Scripts(脚本引用丢失) 请看下面的两张图的Warn(脚本引用丢失),在某些情况下我们会遇到这个警告. 二.解决办法 参考资料 http://unitygems.com/la ...
- Unity-WIKI 之 AllocationStats(内存分配)
组件功能 allocationstats是一个简单的辅助工具,用于显示您的应用程序分配多少内存.它采用GC.GetTotalMemory来跟踪内存使用 使用方法 添加 Allocmem.cs 到场景中 ...
- ubuntu手贱改了sudoers权限之后的恢复
sudo 这个命令是ubuntu系统是用的最多的(和其他大众版linux系统比起来),而一个普通用户是否有sudo权限来临时切换到root用户来执行“一行”命令取决于 /etc/sudoers的配置, ...
- SQL 数据结构操作语句
修改字段 exec sp_rename '表名.[字段名]','新字段名','column' alter table tab_info rename column createname to this ...
- Socket Programming in C#--Server Side
Server Side If you have understood whatever I have described so far, you will easily understand the ...