标签:parameter index out index out of range 3
String sql2 = "insert into supplygoods(id,supplyaccount,goodsaccount,state)values(19,?,?,?)"; try { PreparedStatement stm2 = conn.prepareStatement(sql2); // 结果集 stm2.setInt(1, g.getSupplyAccount()); stm2.setInt(2, g.getAccount()); stm2.setInt(3, 0); stm2.execute();
原因:sql2中有三个?,设置数据的时候,也需要为sql2设置三个数据,
如果:你只为sql2设置了2个数据,则会出现如上问题。
兔子--Parameter index out of range (3 > number of parameters, which is 2).
标签:parameter index out index out of range 3
原文地址:http://blog.csdn.net/u013425527/article/details/45420797