Opa ta rolando um erro muito estranho quando eu tento usar o preparestatment
public static module.database.Usuario login(String login, String senha) throws SQLException {
module.database.Usuario a;
try (PreparedStatement stat = Database.getCon().prepareStatement("SELECT * FROM usuario u WHERE u.login = '?' AND u.senha = '?'")) {
stat.setString(1, login); // <- Ele diz que o erro ocorre nessa linha
stat.setString(2, senha);
try (ResultSet exe = stat.executeQuery()) {
exe.last();
if (exe.getRow() == 0) {
return null;
}
exe.first();
a = resultSetToUsuario(exe);
}
}
return a;
}
Erro
java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
alguma dica aew ?