@Override public boolean addCategory(String category) { try { cTable.insert(category); } catch (SQLException e) { Logger.getLogger(EmbeddedDB.class.getName()).log(Level.SEVERE, e.getMessage(), e); return false; } return true; }
@Override public List<String> getCategories() { try { return cTable.select(); } catch (SQLException e) { Logger.getLogger(EmbeddedDB.class.getName()).log(Level.SEVERE, e.getMessage(), e); } return Collections.emptyList(); }
@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; }