Package org.apache.beehive.samples.petstore.controls.exceptions

Examples of org.apache.beehive.samples.petstore.controls.exceptions.DataStoreException


            } else {
                return false;
            }
        } catch( SQLException e ) {
            _logger.error( "Unexpected DAO exception", e );
            throw new DataStoreException( "unexpected database exception" );
        }
    }
View Full Code Here


    {
        try {
            return _dbControl.getAccountById( userId );
        } catch( SQLException e ) {
            _logger.error( "Unexpected DAO exception", e );
            throw new DataStoreException( "unexpected database exception" );
        }
    }
View Full Code Here

    {
        try {
            _dbControl.updateAccount( account );
        } catch( SQLException e ) {
            _logger.error( "Unexpected DAO exception", e );
            throw new DataStoreException( "unexpected database exception" );
        }
    }
View Full Code Here

    {
        try {
            _dbControl.insertAccount( account );
        } catch( SQLException e ) {
            _logger.error( "Unexpected DAO exception", e );
            throw new DataStoreException( "unexpected database exception" );
        }
    }
View Full Code Here

    int lastOrder = -1;
    try {
      lastOrder = _dbControl.getLastOrderIdForUser(userId);
    } catch (SQLException e) {
            _logger.error( "Unexpected DAO exception", e );
      throw new DataStoreException("unexpected database exception");
    }
    return lastOrder;
  }
View Full Code Here

      orderId = _dbControl.getLastOrderIdForUser(order.getUserId());
      if (orderId == -1)
      {
        // somehow the order didn't get recorded
              _logger.error( "Unexpected DAO exception");
        throw new DataStoreException("unexpected database exception");
      }
     
          // Add the cart items and update the quantities in the DB
      Item item = null;
          Iterator i = cart.getLineItems().iterator();
          while (i.hasNext())
          {
              LineItem lineItem = (LineItem) i.next();
              _catalogControl.updateItemQuantity(lineItem.getItem().getItemId(), lineItem.getQuantity());
        _dbControl.addOrderItem(orderId, lineItem.getItem().getItemId(), lineItem.getQuantity());
          }
      connection.commit();
      connection.setAutoCommit( true );

    } catch (SQLException e) {
            _logger.error( "Unexpected DAO exception", e );
      throw new DataStoreException("unexpected database exception");
    }
    return orderId;
    }
View Full Code Here

    Order order = new Order();
    try {
      order = _dbControl.getOrder(key, userId);
    } catch (SQLException e) {
            _logger.error( "Unexpected DAO exception", e );
      throw new DataStoreException("unexpected database exception");
    }
        return order;
    }
View Full Code Here

        Order[] orders;
    try {
      orders = _dbControl.getOrderByUserId(userId);
    } catch (SQLException e) {
            _logger.error( "Unexpected DAO exception", e );
      throw new DataStoreException("unexpected database exception");
    }
        return orders;
    }
View Full Code Here

        OrderItem[] orderItems;
    try {
      orderItems = _dbControl.getOrderItems(orderId);
    } catch (SQLException e) {
            _logger.error( "Unexpected DAO exception", e );
      throw new DataStoreException("unexpected database exception");
    }
        return orderItems;
    }
View Full Code Here

    Category[] categories;
    try {
      categories = _dbControl.getCategoryList();
    } catch (SQLException e) {
            _logger.error( "Unexpected DAO exception", e );
      throw new DataStoreException("unexpected database exception");
    }
    return categories;
    }
View Full Code Here

TOP

Related Classes of org.apache.beehive.samples.petstore.controls.exceptions.DataStoreException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.