-3
The error already says it all. You can’t make one run SELECT
in a executeUpdate
. Use a executeQuery
in this case. Change your code to:
String query = "SELECT * FROM userloja WHERE email = ? AND senha = ?";
PreparedStatement ps = conectarMysql().prepareStatement(query);
ps.setString(1, loja.getEmail());
ps.setString(2, loja.getSenha());
ResultSet rs = ps.executeQuery();
return rs.isBeforeFirst();
Executes the SQL query in this Preparedstatement Object and Returns the Resultset Object generated by the query.
In free translation:
Executes the SQL query in the Preparedstatement object and returns a Resultset object generated by this query.
Please do not post code as image and do the [tour].
– danieltakeshi