public void mostrar_personas() throws SQLException{
Connection co = null;
PreparedStatement preparedStatement = null;
String consulta = "SELECT * "
+ "FROM personas";
try {
co = iniciarConnection();
preparedStatement = (PreparedStatement) co.prepareStatement(consulta);
System.out.println();
} catch (SQLException e) {
System.out.println(e.getMessage());
} finally {
if (preparedStatement != null) {
preparedStatement.close();
}
if (co != null) {
co.close();
}
}
}
This is the first time I've been handling Database from Java and I have doubts that I would greatly appreciate an answer, again, thank you very much in advance to all