@Override public boolean addUser(UserPOJO user, String password) { try { return uTable.insert(user, password); } catch (SQLException e) { Logger.getLogger(EmbeddedDB.class.getName()).log(Level.SEVERE, e.getMessage(), e); } return false; }
@Override public UserPOJO connectUser(String id, String password) { try { Optional<UserPOJO> op = uTable.exist(id, password); return op.isPresent() ? op.get() : null; } catch (SQLException e) { Logger.getLogger(EmbeddedDB.class.getName()).log(Level.SEVERE, e.getMessage(), e); } return null; }
@Override public boolean clear() { try { boolean bDelete = bTable.delete(); boolean uDelete = uTable.delete(); boolean cDelete = cTable.delete(); return bDelete && uDelete && cDelete; } catch (SQLException e) { Logger.getLogger(EmbeddedDB.class.getName()).log(Level.SEVERE, e.getMessage(), e); } return false; }