在java中使用jdbc操作数据库,在使用PreparedStatement.setString时出现一个疑惑PreparedStatement.setString(index, "");如果是单次设置,那么index从1开始,如果放在循环里setString,index是从几设置的呢?现在想看setString中的具体源码,但是找到的都是PreparedStatement借口中的方法啊~~~~~具体的实现类在哪里= =有没有哪个大侠知道,告知一下
谢谢

解决方案 »

  1.   

    老哥 ,咋有问题?,我是看了接口说明上是这么写的    * @param parameterIndex the first parameter is 1, the second is 2, ...
         * @param x the parameter value
         * @exception SQLException if parameterIndex does not correspond to a parameter
         * er in the SQL statement; if a database access error occurs or 
         * this method is called on a closed <code>PreparedStatement</code>
         */
        void setString(int parameterIndex, String x) throws SQLException;
      

  2.   

    关键是我我加for循环时,第二次就不是了~~就一直参数错误的报错
      

  3.   

    关键是我加for循环时,第二次就不是了~~就一直参数错误的报错
      

  4.   

    关键是我加for循环时,第二次就不是了~~就一直参数错误的报错你有几个占位符就设置几次,从1开始,代码贴出来看看???