一、错误原因分析

从错误提示可以看出:实际传入的参数大于sql中待设置的参数,也就是sql中的?少于参数或?根本没有
产生原因:

 ?号被单引号包围

如:

sql += " and article_title like '%#{articleTitle}%'";

二、解决办法

去掉单引号

上面sql改为:

sql += " and article_title like concat('%',#{articleTitle},'%')";

【Mybatis异常】Caused by: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).的更多相关文章

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

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

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

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

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

  6. Parameter index out of range (1 > number of parameters, which is 0).

    数据库错误:Parameter   index   out   of   range   (1   >   number   of   parameters,   which   is   0) ...

  7. java.sql.SQLException: Parameter index out of range (0 < 1 ).

    向SQL中传入数据是从1开始的!!! 从ResultSet中取数据也是从1开始的!

  8. org.springframework.dao.TransientDataAccessResourceException: PreparedStatementCallback.....Parameter index out of range (1 > number of parameters, which is 0).;

    sql有误,一般是   sql语句少了问号.

  9. Parameter index out of range (2 > number of parameters, which is 1)

    今天在实现一个功能时遇到一个问题,解决了很久.结果是#{}与${}使用错误的原因.但是具体原因还不是很清楚,写此篇总结,知道的可以交流. 具体描述为:通过教师的头衔(1高级讲师2首席讲师)及名称进行模 ...

随机推荐

  1. GhostVLAD for set-based face recognition

    GhostVLAD for set-based face recognition 中提到了文章解决的是template-based face recognition. VLAD: vector of ...

  2. spark org.apache.spark.ml.linalg.DenseVector cannot be cast to org.apache.spark.ml.linalg.SparseVector

    在使用 import org.apache.spark.ml.feature.VectorAssembler 转换特征后,想要放入 import org.apache.spark.mllib.clas ...

  3. 设计模式php+java版本(1) 基础篇 七大原则

    2019年9月6日11:15:46 关于设计模式,其实就是编程思想的一个体现,有比较完善的编程思想写出的项目代码和没有编程思想的写出的差距巨大,代码的可读性,可维护性,可扩展性天差地别,有些刚接触的编 ...

  4. 如何在Debian 9上安装和使用Docker

    介绍 Docker是一个简化容器中应用程序进程管理过程的应用程序.容器允许您在资源隔离的进程中运行应用程序.它们与虚拟机类似,但容器更便携,更加资源友好,并且更依赖于主机操作系统. 在本教程中,您将在 ...

  5. K8S+GitLab+.net core-自动化分布式部署-3

    K8S+GitLab-自动化分布式部署ASP.NET Core(三) 更新镜像版本并部署到K8S上   一.介绍 前一篇,介绍了ASP.NET Core部署到K8S上,下面介绍我们在发布新一版本中怎么 ...

  6. RestTemplate支持GET方法携带Body信息

    首先必须声明: GET方法支持通过Body携带参数(HTTP1.1开始支持) 但是默认的RestTemplate是不支持滴!原因如下: RestTemplate支持通过setRequestFactor ...

  7. 19 SpringMVC 拦截器

    1. 拦截器的概述(1)SpringMVC框架中的拦截器用于对处理器进行预处理和后处理的技术.(2)可以定义拦截器链,连接器链就是将拦截器按着一定的顺序结成一条链,在访问被拦截的方法时,拦截器链 中的 ...

  8. MySQL恩恩怨怨

    数据库基础 Windows安装MySQL Mac安装MySQL Linux安装MySQL MySQL存储引擎概述 MySQL表操作 MySQL支持的数据类型 MySQL表的完整性约束 MySQL记录操 ...

  9. F1 相似查找字段存在的table

    REPORT ZME12_BDC1. *REPORT demo_select_dynamic_conditions . TABLES: makt,dd02t,marc. TYPE-POOLS : AB ...

  10. python 2种创建多线程的方法

    多个线程是可以操作同一个全局变量的,因此,可以通过这种方式来判断所有线程的执行进度 # 第一种方法:将要执行的方法作为参数传给Thread的构造方法 import threading import t ...