IDEA_MyBatis_SQLException:Parameter index out of range坑
报错信息:超出数据库数据表设定的规定长度了
nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='apply_id', mode=IN, javaType=class java.lang.Object, jdbcType=BIGINT, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 with JdbcType BIGINT . Try setting a different JdbcType for this parameter or a different configuration property. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 with JdbcType BIGINT . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1
网上说的解决方案大概如下:
这是占位符的数量 跟 设置的参数数量不相等造成的,检查一下你写的sql和传递的参数吧。
特定写like语句所发生的情况:
若是写like语句的时候 ,所用引起的;
在mybatis里面写就是应该是 like '%${name} %' 而不是 '%#{name} %'
注:${name} 是不带单引号的,而#{name} 是带单引号的
***如果是还不是:可能是注释的原因 --这就是我的坑,主要是IDEA还显示好使,不报错,坑爹呀!长记性了!
因为注释加的位置不对!!

IDEA_MyBatis_SQLException:Parameter index out of range坑的更多相关文章
- Parameter index out of range (2 > number of parameters, which is 1)
今天在实现一个功能时遇到一个问题,解决了很久.结果是#{}与${}使用错误的原因.但是具体原因还不是很清楚,写此篇总结,知道的可以交流. 具体描述为:通过教师的头衔(1高级讲师2首席讲师)及名称进行模 ...
- Caused by: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0
1.错误描述 [ERROR:]2015-05-05 16:35:50,664 [异常拦截] org.hibernate.exception.GenericJDBCException: error ex ...
- mybatis中Parameter index out of range (1 > number of parameters, which is 0).
Parameter index out of range (1 > number of parameters, which is 0).(参数索引超出范围) 在mybatis里面写就是应该是 l ...
- 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. ...
- java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0). at co ...
- [转]操作MySQL数据库报出:Parameter index out of range (1 > number of parameters, which is
原文地址:https://blog.csdn.net/zdx_y/article/details/52072914 对MySQL进行insert操作,控制台抛出以下错误:Parameter index ...
- Mabatis错误--Parameter index out of range
昨天遇到一个错误,之前也遇到过,但是之前遇到很快就解决了,昨天遇到这个错误当时看了大概10来分钟,还是没搞好,今天才来搞好了. 错误信息如下 08:34:43,302 DEBUG getTeacher ...
- Parameter index out of range (1 > number of parameters, which is 0).
数据库错误:Parameter index out of range (1 > number of parameters, which is 0) ...
- Parameter index out of range(1 > number of parameters, which is 0)参数索引超出范围
今天在写项目的过程中,有一个模块是做多选删除操作,通过servlet获得多选框的value组,然后执行sql操作.如下: 1 @RequestMapping( "/delteCouse.do ...
随机推荐
- ansible基础配置使用(一)
test test test
- Python Road
引子 雁离群兮不知所归,路遥远兮吾将何往 Python Road[第一篇]:Python简介 Python Road[第二篇]:Python基本数据类型 Python Road[第三篇]:Pyth ...
- hdu1010Tempter of the Bone(迷宫dfs+剪枝)
Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Othe ...
- OSG-HUD
本文转至http://www.cnblogs.com/shapherd/archive/2010/08/10/osg.html 作者写的比较好,再次收藏,希望更多的人可以看到这个文章 互联网是是一个相 ...
- SQL注入篇二------利用burp盲注,post注入,http头注入,利用burpsuit找注入点,宽字节注入
1.布尔盲注burpsuit的使用 先自己构造好注入语句,利用burpsuit抓包,设置变量,查出想要的信息. 比如----查数据库名的ascii码得到数据库构造好语句 http://123.206. ...
- python3 爬虫爬取深圳公租房轮候库(深圳房网)
深圳公租房轮候库已经朝着几十万人的规模前进了,这是截至16年10月之前的数据了,贴上来大家体会下 所以17年已更新妥妥的10W+ 今天就拿这个作为爬虫的练手项目 1.环境准备: 操作系统:win10 ...
- word record 2
word record 2 scavenger // si ga wen ger a person, animal or insect who takes what others have left ...
- 【MFC】VS2017新建完MFC后,没有界面,只有代码
问题描述:双击.rc文件后提示在另一个编辑器中打开 解决方法整合: 1----- 打开工程之前先把.rc文件改个名称,然后打开工程双击解决方案管理器的.rc文件, 会显示"载入失败" ...
- Mishka and Contest(模拟水题)
Mishka started participating in a programming contest. There are nn problems in the contest. Mishka' ...
- 找bug——加分作业
bug1:while循环中的*des++ =*src++; 不能这么写吧... bug2:maxSize没有定义 暂时看到这么多