// Register the driver once in the constructor.
private Connection getConectar() throws SQLException {
return DriverManager.getConnection(url, login, password);
}
public boolean Update (String update) {
int result;
try (Connection connection = getConectar()){
try (Statement statement = connection.createStatement()) {
result = statement.executeUpdate(update);
}
}
catch (SQLException e) {
System.out.println("Exception in update method:\n" + e.getMessage());