protected boolean conect() {
try {
Class.forName(driver);
cn = DriverManager.getConnection(url + database, user, password);
return true;
} catch (ClassNotFoundException e) {
logger.warning(e.getMessage());
return false;
} catch (SQLException e) {
logger.warning(String.format("Code: %s | Message: %s", e.getErrorCode(), e.getMessage()));
return false;
}
}
protected boolean disconect() {
try {
cn.close();
return true;
} catch (SQLException e) {
logger.warning(String.format("Code: %s | Message: %s", e.getErrorCode(), e.getMessage()));
}
return false;
}
public Person insert(Person person);
public Person update(int id, Person personUpdated);
public Person delete(int id);
public List<Person> getAll();
public Person findById(int id);
public List<Person> list(int[] listPerson);