1.错误描述 [ERROR:]2015-05-05 16:35:50,664 [异常拦截] org.hibernate.exception.GenericJDBCException: error executing work at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54) at org.hibernate.engine.…
Parameter index out of range (1 > number of parameters, which is 0).(参数索引超出范围) 在mybatis里面写就是应该是 like  '%${name} %' 而不是 '%#{name} %'   ${name} 是不带单引号的,而#{name} 是带单引号的 所以,当你用到 like '%#{name}%' 会报这种错误 ----------------------------------更新 20181114-------…
java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0). at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1056) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957) at com.mysql.jdbc.SQLError.…
数据库错误:Parameter   index   out   of   range   (1   >   number   of   parameters,   which   is   0). 错误发生原因其实很简单,就是当设置参数时,没有相应的问号与之匹配(或者根本就没有?号). 如果是:Parameter   index   out   of   range   (26   >   number   of   parameters,  which   is   25).  翻译为:找到…
今天在写项目的过程中,有一个模块是做多选删除操作,通过servlet获得多选框的value组,然后执行sql操作.如下: 1 @RequestMapping( "/delteCouse.do" ) 2 public void delCouse( HttpServletRequest req, HttpServletResponse resp ) throws SQLException { 3 4 //处理中文 5 try { 6 req.setCharacterEncoding(&qu…
一.错误原因分析 从错误提示可以看出:实际传入的参数大于sql中待设置的参数,也就是sql中的?少于参数或?根本没有产生原因:  ?号被单引号包围 如: sql += " and article_title like '%#{articleTitle}%'"; 二.解决办法 去掉单引号 上面sql改为: sql += " and article_title like concat('%',#{articleTitle},'%')";…
原文地址:https://blog.csdn.net/zdx_y/article/details/52072914 对MySQL进行insert操作,控制台抛出以下错误:Parameter index out of range (1 > number of parameters, which is 0) 调试了半天后查找资料后,问题就出在当设置参数时,没有相应的问号与之匹配或者根本就没有?号. String sql = "insert into t_courler(UserId,Courl…
今天在实现一个功能时遇到一个问题,解决了很久.结果是#{}与${}使用错误的原因.但是具体原因还不是很清楚,写此篇总结,知道的可以交流. 具体描述为:通过教师的头衔(1高级讲师2首席讲师)及名称进行模糊查询,报如下错误: org.springframework.dao.TransientDataAccessResourceException: ### Error querying database.  Cause: java.sql.SQLException: Parameter index o…
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). at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1056)…