执行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. Emacs: 设置窗口标题格式

    Emacs默认的窗口标题常常比较简单,例如我的默认标题是"emacs@ubuntu".如果想要在标题中显示更多的信息,我们可以对它进行一些设置.由于Emacs的可扩展性,这种修改实 ...

  2. 四十八、在SAP中函数参数的使用

    一.不带参数的函数定义如下 二.我们把函数内部会变化的变量以参数的形式定义,其中USING和CHANGING分别表示变量和返回值,因为so_car表示的是工作区,所以后面加上[]符号. 三.我们把2个 ...

  3. SQL 、LINQ日前比较

      using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; ...

  4. Python写一个简单的爬虫

    code #!/usr/bin/env python # -*- coding: utf-8 -*- import requests from lxml import etree class Main ...

  5. Python MongoDB 创建集合

    章节 Python MySQL 入门 Python MySQL 创建数据库 Python MySQL 创建表 Python MySQL 插入表 Python MySQL Select Python M ...

  6. vue学习(七)refs的使用

    ref的使用只有在特殊的情况下使用 1.如果给标签添加ref,获取的就是真实的DOM节点2. 如果给子组件添加ref,获取的就是当前的子组件对象 例子: <div id="app&qu ...

  7. pythpon--类操作

    #coding=utf-8import numpy as npimport tensorflow as tfimport osos.environ["CUDA_VISIBLE_DEVICES ...

  8. ContentProvider ContentResolver ContentObserver 内容:提供、访问、监听

    内容提供 public class PersonContentProvider extends ContentProvider{ private static final String AUTHORI ...

  9. bzoj 3732Network

    先搞个最小生成树,然后lca(和之前的一个cf题差不多2333, 纯属颓废了..) 顺便思考了一下正确性. 因为所求的是所有路径中最大边的最小值.而kruskal每次往里添加的就是最小边.所以在生成树 ...

  10. 如何保障Assignment写作效率?

    有没有因为开学要交的Assignment而日夜赶工.身心俱疲啊?写Assignment确实是个体力+脑力活,要一直保持旺盛的精力并不容易.精神和身体的疲劳会慢慢分散你的注意力,进而影响效率和写作质量. ...