新手发帖,关于参数索引越界,蛋疼//........
String sql="select * from tb_user where username=?and mypassword =?";
conn=ConnectionFactory.getConnection();
try {
psmt=conn.prepareStatement(sql);
psmt.setString(1, user.getUsername());
psmt.setString(2, user.getPassword());
执行到这里就会报错
java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1).