예제 #1
0
 @Override
 public boolean insert(Connection connection, Category category) throws SQLException {
   Integer newId =
       insertQuery(connection, SQL_INSERT_QUERY, category.getName(), category.getImageUrl());
   setId(category, newId);
   return newId != null;
 }
예제 #2
0
 @Override
 public boolean update(Connection connection, int id, Category category) throws SQLException {
   return changeQuery(
       connection, SQL_UPDATE_QUERY, category.getName(), category.getImageUrl(), id);
 }