原文地址: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,CourlerTitle,CourlerContent,CourlerMoney,CourlerWeight) values(?,?,?,?,?)";

同时需要注意的是,sql语句中的’?’是英文的,很有可能这种小问题没有注意到。?外也不要搞一对单引号,不然会当做参数传入到set方法中。

[转]操作MySQL数据库报出:Parameter index out of range (1 > number of parameters, which is的更多相关文章

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

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

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

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

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

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

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

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

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

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

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

  9. jdbcTemplate异常:like模糊查询报错(Parameter index out of range (1 > number of parameters)

    http://cuisuqiang.iteye.com/blog/1480525   模糊查询like要这样写 注意Object参数和like语法   public static void main( ...

随机推荐

  1. Intellij Idea免费激活方法

    填入下面的license server: http://intellij.mandroid.cn/http://idea.imsxm.com/http://idea.iteblog.com/key.p ...

  2. yum install mysql56

    官方有写: http://dev.mysql.com/doc/mysql-repo-excerpt/5.6/en/linux-installation-yum-repo.html yum update ...

  3. php性能分析工具xhprof

    安装方法: wget http://pecl.php.net/get/xhprof-0.9.x.tgz cp xhprof-0.9.x.tgz /home/www/xhprof.tgz tar zxv ...

  4. Intent----android中的伟大邮差

    在android中,intent就像是一个邮差,辛勤高效的在各个组件之间来回穿梭.我们可以通过它启动一个Activity或者Service,或者是发送给广播组件,又或者是与后台的Service进行通信 ...

  5. Android Studio:正确导入SO相关文件

      导入so文件有2种方式 第一种: 使用jniLibs文件夹导入so文件,则仅需将所有cpu类型的文件夹拷进去. 在project结构下,module目录下创建libs文件夹,放入jar文件:在sr ...

  6. SharePoint 2013 Farm 安装指南——Least Privilege

    写过很多关于SharePoint 2013 安装,这是第四篇.可能你会觉得为什么如此简单的安装至于花那么多精力去折腾吗.我的答案是肯定的.知识的积累不是一蹴而就的,而是循序渐进的去学习,每一个阶段都有 ...

  7. ES6--变量的声明及解构赋值

    ​ ES6的目标是使得JavaScript语言能够用来编写大型的复杂的应用程序.成为企业级开发语言:该标准已于2015年6月17日正式公布. 可是真正的普及我觉得还得须要一段时间.然而这并非理由让我们 ...

  8. matlab入门笔记(七):数据文件I/O

  9. HEVC (H.265)介绍(转)

    [Liupin]: 这是一篇简单介绍H.265文章,我接触和开发H.265二年来,H.265技术在行业内接收速度比H.264快多了,现在国际和国内各大公司都在进行H.265应用,不管是IC设计还是H. ...

  10. Hadoop JobTracker和NameNode运行时参数查看

      1)JobTracker运行时参数: hadoop@ubuntu:/home/zhangchao3$ ps -ef | grep job hadoop 29563 1 0 11:34 pts/12 ...