执行mybaits sql

    <delete id="delete4BatchesByLineCi" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" separator=";">
-- update VPN_FIREWALL set is_delete = true where where LINE_CI = #{item}
delete from VPN_FIREWALL where LINE_CI = #{item, jdbcType=VARCHAR}
</foreach>
</delete>
提示错误:
 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException:
Could not set parameters for mapping: ParameterMapping{property='__frch_item_0', mode=IN, javaType=class java.lang.String, jdbcType=VARCHAR, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}.
Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 with JdbcType VARCHAR .
Try setting a different JdbcType for this parameter or a different configuration property.
Cause: org.postgresql.util.PSQLException: 栏位索引超过许可范围:2,栏位数:1。\

根据网上类似问题解决方案,都不能解决此问题,对比在另一处 这种用法没有问题,删除注释行 ,问题解决。

--update VPN_FIREWALL set is_delete = true where where LINE_CI = #{item}

Try setting a different JdbcType for this parameter or a different configuration property. Cause: org.postgresql.util.PSQLException: 栏位索引超过许可范围:2,栏位数:1的更多相关文章

  1. 又一个无效的列类型错误Error setting null for parameter #7 with JdbcType NULL . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLExcept

    在更新数据时候出现的错误 更新代码如下: <update id="modify" parameterType="Standard"> update ...

  2. Parameter index out of range(1 > number of parameters, which is 0)参数索引超出范围

    今天在写项目的过程中,有一个模块是做多选删除操作,通过servlet获得多选框的value组,然后执行sql操作.如下: 1 @RequestMapping( "/delteCouse.do ...

  3. java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2).

    java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2). java. ...

  4. IDEA_MyBatis_SQLException:Parameter index out of range坑

    报错信息:超出数据库数据表设定的规定长度了 nested exception is org.apache.ibatis.type.TypeException: Could not set parame ...

  5. Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (16944839 > 16777216). You can change this value on the server by setting the max_allowed_packet' variable.

    今天发现task微服务的error日志报如下错误: Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large ...

  6. MyBatis 源码分析——类型处理器

    官网上面讲到:无论是 MyBatis 在预处理语句(PreparedStatement)中设置一个参数时,还是从结果集中取出一个值时, 都会用类型处理器将获取的值以合适的方式转换成 Java 类型.那 ...

  7. 【MyBatis源码分析】insert方法、update方法、delete方法处理流程(下篇)

    Configuration的newStatementHandler分析 SimpleExecutor的doUpdate方法上文有分析过: public int doUpdate(MappedState ...

  8. Mybatis源码学习之TypeHandler

    ORM框架最重要功能是将面向对象方法中的对象和关系型数据库中的表关联了起来,在关联过程中就必然涉及到对象中的数据类型和数据库中的表字段类型的转换,Mybatis中的org.apache.ibatis. ...

  9. mybatis的typeHandler

    typeHandler作用: 1.传参时将javaType类型转换成jdbcType 2.结果集中ResultSet中取值时,jdbcType转换为javaType; 系统自定义的typeHandle ...

随机推荐

  1. 吴裕雄 Bootstrap 前端框架开发——Bootstrap 字体图标(Glyphicons):glyphicon glyphicon-signal

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name ...

  2. Linux学习《第四章shell脚本练习一》随堂练习(重要)

  3. netty权威指南学习笔记八——编解码技术之JBoss Marshalling

    JBoss Marshalling 是一个java序列化包,对JDK默认的序列化框架进行了优化,但又保持跟java.io.Serializable接口的兼容,同时增加了一些可调参数和附加特性,这些参数 ...

  4. [ cocos2d-JS ] 创建项目命令

    cocos new HelloJS -l js -p com.neworigin.HelloJS -d D:\0-Game\cocosJS-project

  5. Pycharm使用python3无法通过HTMLTestRunner生成测试报告《转载》

    Pycharm使用python3无法通过HTMLTestRunner生成测试报告: https://blog.csdn.net/weixin_38981172/article/details/8238 ...

  6. 一、JavaScript之第一个实例,点击按钮修改文本内容

    一.代码如下: 二.运行后效果如下 三.点击按钮,"曾经沧海难为水"变成了日期事件了 <!DOCTYPE html> <html> <meta htt ...

  7. Day 21:网络编程(2)

    以课程中feiQ为例,feiQ作为一个典型的网络编程应用,用一段代码尝试给自己的发送消息 import java.io.IOException; import java.net.DatagramPac ...

  8. Apache使用mod_jk/mod_proxy模块实现代理、负载均衡的配置

    转载自:https://blog.csdn.net/yuanyuan_186/article/details/51290518 192.168.1.123/192.168.1.121为后端tomcat ...

  9. LeetCode#7 整数反转(数学)

    题目: 思路:(题外话:好久不刷题,明显生疏了好多,要捡起来记住当初那一份热爱!) 判断溢出的方法,在将数字反转的同时,专注在int的最大值/10和最小值/10这两个数上进行判断就可以了: 拿正数为例 ...

  10. C语言拾遗——sscanf

    今天写题用到了sscanf,怕忘赶紧记录一下 去百度了一下这玩意的函数原型好像是长这样的,微软上扣下来的  int sscanf( const char *buffer, const char *fo ...