Good morning,
By making a database query from java, I am unable to know how to interpret the results. I have the following code, which should find me in a database if the game is included and if the column also belongs to "-".
Statement st = comprueba.createStatement();
boolean isInsert;
try (PreparedStatement ps = comprueba.prepareStatement("SELECT * FROM info_XboxOne WHERE Juego = ? AND Pertenece = ?")) {
ps.setString(1, game);
ps.setString(2, "-");
try (ResultSet rs = ps.executeQuery()) {
isInsert = !rs.next();
}
}
if (!isInsert) { //si se cumple esta condicción significa que se cumplen las condiciones de juego base y que no pertenezca a ninguno
resultado = "Si";
}
The fact is that it is not working for me. If it gives me some result it is because both conditions are met, and then the variable resultado
will become "Yes". But something I have to be doing wrong. Is there any similar way to see the result that I get from the query as var_dump
in PHP?