I have this select query. How would I know if the query has found a match on the database?
try{
PreparedStatement fetchPlayers = conn.prepareStatement("SELECT * FROM players WHERE P_Name='" + player + "'");
fetchPlayers.executeQuery();
}catch(Exception e){}
I tried doing this but it always returns true even if I input something that is not in the database.
if(fetchPlayers.execute()==true){
System.out.println("True");
}