java.sql.SQLException Parameter index out of range (1 > number of parameters, which is 0) [closed]
You will get this error when you call any of the setXxx() methods on PreparedStatement, while the SQL query string does not have any placeholders ? for this. For example this is wrong: String sql = “INSERT INTO tablename (col1, col2, col3) VALUES (val1, val2, val3)”; // … preparedStatement = connection.prepareStatement(sql); preparedStatement.setString(1, val1); // Fail. … Read more