Package org.apache.stonehenge.stocktrader

Examples of org.apache.stonehenge.stocktrader.CustomHoldingBean


    CustomerDAO customerDAO = fac.getCustomerDAO();
    return customerDAO.getHoldingForUpdate(orderId);
  }

  public CustomHoldingBean getHolding(int holdingId) throws DAOException {
    CustomHoldingBean holding = null;
    PreparedStatement selectHoldingStat = null;
    try {
      selectHoldingStat = sqlConnection.prepareStatement(SQL_SELECT_HOLDING);
      selectHoldingStat.setInt(1, holdingId);
      ResultSet rs = selectHoldingStat.executeQuery();
      if (rs.next()) {
        try {
          holding = new CustomHoldingBean(
              rs.getInt(1),
              rs.getDouble(2),
              rs.getBigDecimal(3),
              StockTraderUtility.convertToCalendar(rs.getDate(4)),
              rs.getString(5),
View Full Code Here


    public CustomHoldingBean getHoldingForUpdate(int orderId) throws DAOException {
        if (logger.isDebugEnabled()) {
            logger.debug("MSSQLCustomerDAO.getHoldingForUpdate(int)\nOrder ID :" + orderId);
        }

        CustomHoldingBean holding = null;
        PreparedStatement selectHoldingLockStat = null;
        try {
            selectHoldingLockStat = sqlConnection.prepareStatement(SQL_SELECT_HOLDING_LOCK);
            selectHoldingLockStat.setInt(1, orderId);
            ResultSet rs = selectHoldingLockStat.executeQuery();
            if (rs.next()) {
                try {
                    holding = new CustomHoldingBean(
                            rs.getInt(1),
                            rs.getInt(2),
                            rs.getDouble(3),
                            rs.getBigDecimal(4),
                            StockTraderUtility.convertToCalendar(rs.getDate(5)),
View Full Code Here

    public CustomHoldingBean getHolding(String userId, int holdingID)
            throws DAOException {
        if (logger.isDebugEnabled()) {
            logger.debug("MSSQLCustomerDAO.getHolding(String,int)\nUserID :" + userId + "\nOrder ID :" + holdingID);
        }
        CustomHoldingBean holding = null;
        PreparedStatement selectHoldingNoLockStat = null;
        try {
            selectHoldingNoLockStat = sqlConnection.prepareStatement(SQL_SELECT_HOLDING_NOLOCK);
            selectHoldingNoLockStat.setInt(1, holdingID);
            selectHoldingNoLockStat.setString(2, userId);

            ResultSet rs = selectHoldingNoLockStat.executeQuery();
            if (rs.next()) {
                try {
                    holding = new CustomHoldingBean(
                            rs.getInt(1),
                            holdingID,
                            rs.getDouble(2),
                            rs.getBigDecimal(3),
                            StockTraderUtility.convertToCalendar(rs.getDate(4)),
View Full Code Here

            selectHoldings.setString(1, userID);
            ResultSet rs = selectHoldings.executeQuery();
            List<CustomHoldingBean> holdings = new ArrayList<CustomHoldingBean>();
            try {
                while (rs.next()) {
                    CustomHoldingBean holding = new CustomHoldingBean(
                            rs.getInt(1),
                            rs.getDouble(2),
                            rs.getBigDecimal(3),
                            StockTraderUtility.convertToCalendar(rs.getDate(4)),
                            rs.getString(5), rs.getInt(6));
View Full Code Here

    public CustomHoldingBean getHoldingForUpdate(int orderId) throws DAOException {
        if (logger.isDebugEnabled()) {
            logger.debug("MySQLCustomerDAO.getHoldingForUpdate(int)\nOrder ID :" + orderId);
        }

        CustomHoldingBean holding = null;
        PreparedStatement selectHoldingLockStat = null;
        try {
            selectHoldingLockStat = sqlConnection.prepareStatement(SQL_SELECT_HOLDING_LOCK);
            selectHoldingLockStat.setInt(1, orderId);
            ResultSet rs = selectHoldingLockStat.executeQuery();
            if (rs.next()) {
                try {
                    holding = new CustomHoldingBean(
                            rs.getInt(1),
                            rs.getInt(2),
                            rs.getDouble(3),
                            rs.getBigDecimal(4),
                            StockTraderUtility.convertToCalendar(rs.getDate(5)),
View Full Code Here

    public CustomHoldingBean getHolding(String userId, int holdingID) throws DAOException {
        if (logger.isDebugEnabled()) {
            logger.debug("MSSQLCustomerDAO.getHolding(String,int)\nUserID :" + userId + "\nOrder ID :" + holdingID);
        }
        CustomHoldingBean holding = null;
        PreparedStatement selectHoldingNoLockStat = null;
        try {
            selectHoldingNoLockStat = sqlConnection.prepareStatement(SQL_SELECT_HOLDING_NOLOCK);
            selectHoldingNoLockStat.setInt(1, holdingID);
            selectHoldingNoLockStat.setString(2, userId);

            ResultSet rs = selectHoldingNoLockStat.executeQuery();
            if (rs.next()) {
                try {
                    holding = new CustomHoldingBean(
                            rs.getInt(1),
                            holdingID,
                            rs.getDouble(2),
                            rs.getBigDecimal(3),
                            StockTraderUtility.convertToCalendar(rs.getDate(4)),
View Full Code Here

            selectHoldings.setString(1, userID);
            ResultSet rs = selectHoldings.executeQuery();
            List<CustomHoldingBean> holdings = new ArrayList<CustomHoldingBean>();
            try {
                while (rs.next()) {
                    CustomHoldingBean holding = new CustomHoldingBean(
                            rs.getInt(1),
                            rs.getDouble(2),
                            rs.getBigDecimal(3),
                            StockTraderUtility.convertToCalendar(rs.getDate(4)),
                            rs.getString(5),
View Full Code Here

    response.setGetClosedOrdersReturn(arrayOfOrderBean);
    return response;
  }

  public GetHoldingResponse getHolding(GetHolding getHolding) {
    CustomHoldingBean holding;
    try {
      holding = mgr.getHolding(getHolding.getUserID(), getHolding.getHoldingID());
    } catch (DAOException e) {
      logger.debug("", e);
      throw new RuntimeException(e);
View Full Code Here

  public CustomOrderBean placeOrder(String orderType, String userID,
      int holdingID, String symbol, double quantity) throws DAOException {
    OrderDAO orderDAO = factory.getOrderDAO();
    CustomOrderBean order = null;
    CustomHoldingBean holding = new CustomHoldingBean();
    try {

      orderDAO.beginTransaction();
      order = createOrder(orderType, userID, holdingID, symbol, quantity,
          holding);
View Full Code Here

    CustomerDAO customerDAO = fac.getCustomerDAO();
    return customerDAO.getHoldingForUpdate(orderId);
  }

  public CustomHoldingBean getHolding(int holdingId) throws DAOException {
    CustomHoldingBean holding = null;
    PreparedStatement selectHoldingStat = null;
    try {
      selectHoldingStat = sqlConnection.prepareStatement(SQL_SELECT_HOLDING);
      selectHoldingStat.setInt(1, holdingId);
      ResultSet rs = selectHoldingStat.executeQuery();
      if (rs.next()) {
        try {
          holding = new CustomHoldingBean(
              rs.getInt(1),
              rs.getDouble(2),
              rs.getBigDecimal(3),
              StockTraderUtility.convertToCalendar(rs.getDate(4)),
              rs.getString(5),
View Full Code Here

TOP

Related Classes of org.apache.stonehenge.stocktrader.CustomHoldingBean

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.