原文地址:http://www.cnblogs.com/sdjnzqr/p/4304874.html

在使用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 错误的更多相关文章

  1. Mybatis出现:无效的列类型: 1111 错误

    在使用Mybatis时,不同的xml配置文件,有的会提示:无效的列类型: 1111 比如这个sql: update base.sys_person t set t.rybh=#{rybh},t.xm= ...

  2. 【错误笔记】MyBatis SQLException: 无效的列类型: 1111

    问题描述: org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #1 with J ...

  3. Java.sql.SQLException: 无效的列类型: 1111

    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: ...

  4. oracle: jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型: 1111

    https://www.cnblogs.com/mmlw/p/5808072.html org.mybatis.spring.MyBatisSystemException: nested except ...

  5. 报错:无效的列类型: 1111;must be specified for all nullable parameters.

    org.springframework.jdbc.UncategorizedSQLException: Error setting null parameter. Most JDBC drivers ...

  6. mybatis出现无效的列类型

    package com.webapp.hanqi.test; import java.util.Date; import org.junit.jupiter.api.AfterEach; import ...

  7. MYBATIS 无效的列类型: 1111

    查询的时候竟然也会报错,如果参数是数字,需要加上jdbcType 在xml中加上 t.chart_id = #{chartId,jdbcType=DECIMAL}

  8. 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

  9. Mybatis:使用bean传值,当传入值为Null时,提示“无效的列类型”的解决办法

    问题描述:在使用mybatis对数据库执行更新操作时,parameterType为某个具体的bean,而bean中传入的参数为null时,抛出异常如下:org.mybatis.spring.MyBat ...

随机推荐

  1. RSA Study

    These days I study the RSA Algorithm. It is a little complex, but not very. Also, my study has not f ...

  2. CleanBlog(个人博客+源码)

    CleanBlog是一个高端(低调).大气(简洁)的个人博客系统,之前在网上看到了好多个人博客网站,感觉很酷的,自己也想搭建一个,最近 刚学完SSM(Spring/SpringMVC/MyBatis) ...

  3. 《2016ThoughtWorks技术雷达峰会----js爆炸下的技术选型》

    JS爆炸下的技术选型  刘尚奇    ThoughtWorks, 高级咨询师 JS每6个星期出现一个新框架,那么如何进行JS的选型.以下从四个方面来分析. 1.工具 NPM for all the t ...

  4. Ajax与jQuery、json

    一.Ajax简介 Ajax(Asynchronous JavaScript and Xml)--异步刷新技术 Ajax的关键元素包括以下内容: ① JavaScript语言:Ajax技术的主要开发语言 ...

  5. 深入探讨 java.lang.ref 包

    深入探讨 java.lang.ref 包 本文主要探讨了 java.lang.ref 包的使用方法,以及源码解读.并就该包在不同 JVM 上的表现进行了比较与分析.通过阅读本文,读者可以加深对 jav ...

  6. 关于Kendo UI的使用心得

    1.在筛选里面的条件选项进行编辑 filterable: { extra: false, operators: { string: { startswith: "Starts with&qu ...

  7. 让树莓派开机发送自己的ip到邮箱

    一.代码如下: sendIpMail.py #-*-coding=utf-8-*- import socket import fcntl import struct from email import ...

  8. 快速编写代码zencode

    #是 id .是class $是数字 {}是标签中内容 *个数 ^上一级

  9. 目录结构-内置(AJAX)帮助文档

    Discuz common.js 内置(AJAX)函数帮助文档 作者:cr180 / 整理日期:1970-01-01 / 个人站点:www.cr180.com / Discuz超级管家 showMen ...

  10. spring mvc4的日期/数字格式化、枚举转换

    日期.数字格式化显示,是web开发中的常见需求,spring mvc采用XXXFormatter来处理,先看一个最基本的单元测试: package com.cnblogs.yjmyzz.test; i ...