Пример #1
0
  @Override
  public boolean deleteOrder(Order order) {
    boolean completedDelete = false;

    try {
      cs = bd.getConn().prepareCall("{call deleteOrder(?, ?, ?)}");
      cs.setDate(1, (Date) order.getDate());
      cs.setDouble(2, order.getSubtotal());
      cs.setDouble(3, order.getTotal());

      cs.executeUpdate();

      completedDelete = true;

    } catch (Exception e) {
      System.out.println(e);
    }
    return completedDelete;
  }
Пример #2
0
  @Override
  public boolean updateOrder(
      Order order, java.util.Date oldDate, Double oldSubTotal, Double oldTotal) {
    boolean updateOrder = false;
    try {
      cs = bd.getConn().prepareCall("{call updateOrder(?, ?, ?, ?, ?, ?)}");
      cs.setDate(1, (Date) order.getDate());
      cs.setDouble(2, order.getSubtotal());
      cs.setDouble(3, order.getTotal());
      cs.setDate(4, (Date) oldDate);
      cs.setDouble(5, oldSubTotal);
      cs.setDouble(6, oldTotal);

      cs.executeUpdate();

      updateOrder = true;
    } catch (Exception e) {
      System.out.println(e);
    }
    return updateOrder;
  }