Package org.apache.stonehenge.stocktrader.dal

Examples of org.apache.stonehenge.stocktrader.dal.DAOException


        } catch (SQLException e) {
          logger.debug("", e);
        }
        return quote;
      } else {
        throw new DAOException("No quote entry found");
      }
    } catch (SQLException e) {
      throw new DAOException("", e);
    } finally {
      try {
        if (qouteForUpdateStat != null) {
          qouteForUpdateStat.close();
        }
View Full Code Here


      updateStockPriceVolumeStat.setFloat(5, (float) quantity);
      updateStockPriceVolumeStat.setString(6, quote.getSymbol());
      updateStockPriceVolumeStat.executeUpdate();

    } catch (SQLException e) {
      throw new DAOException("", e);
    } finally {
      try {
        if (updateStockPriceVolumeStat != null) {
          updateStockPriceVolumeStat.close();
        }
View Full Code Here

        } catch (SQLException e) {
          logger.debug("", e);
        }
      }
    } catch (SQLException e) {
      throw new DAOException("", e);
    } finally {
      if (gainers != null) {
        try {
          gainers.close();
        } catch (SQLException e) {
          logger.debug("", e);
        }
      }
    }
    List<CustomQuoteBean> topLosers = new ArrayList<CustomQuoteBean>();
    PreparedStatement losers = null;
    try {
      losers = sqlConnection.prepareStatement(SQL_SELECT_MARKETSUMMARY_LOSERS);
      ResultSet rs = losers.executeQuery();

      try {
        for (int i = 0; rs.next() && i < 5; i++) {
          CustomQuoteBean quote = new CustomQuoteBean(
              rs.getString(1),
                            rs.getString(2),
                            rs.getDouble(3),
              rs.getBigDecimal(4),
                            rs.getBigDecimal(5),
                            rs.getBigDecimal(6),
                            rs.getBigDecimal(7),
                            rs.getDouble(8));
          topLosers.add(quote);
        }
      } finally {
        try {
          rs.close();
        } catch (SQLException e) {
          logger.debug("", e);
        }
      }
    } catch (SQLException e) {
      throw new DAOException("", e);
    } finally {
      if (losers != null) {
        try {
          losers.close();
        } catch (SQLException e) {
View Full Code Here

      previousTransactionIsolation = sqlConnection.getTransactionIsolation();
      sqlConnection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
    } catch (SQLException e) {
      e.printStackTrace();
      logger.debug("", e);
      throw new DAOException("Exception was thrown during the start of transaction", e);
    }
  }
View Full Code Here

    try {
      sqlConnection.commit();
      sqlConnection.setAutoCommit(true);
      sqlConnection.setTransactionIsolation(previousTransactionIsolation);
    } catch (SQLException e) {
      throw new DAOException("Exception is thrown during the commit of transaction", e);
    }
  }
View Full Code Here

    try {
      sqlConnection.rollback();
      sqlConnection.setAutoCommit(true);
      sqlConnection.setTransactionIsolation(previousTransactionIsolation);
    } catch (SQLException e) {
      throw new DAOException("Exception is thrown during the rollback of transaction", e);

    }
  }
View Full Code Here

  public void close() throws DAOException {
    try {
      sqlConnection.close();
    } catch (SQLException e) {
      throw new DAOException("", e);
    }
  }
View Full Code Here

      previousTransactionIsolation = sqlConnection.getTransactionIsolation();
      sqlConnection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
    } catch (SQLException e) {
      e.printStackTrace();
      logger.debug("", e);
      throw new DAOException("Exception was thrown during the start of transaction", e);
    }
  }
View Full Code Here

    try {
      sqlConnection.commit();
      sqlConnection.setAutoCommit(true);
      sqlConnection.setTransactionIsolation(previousTransactionIsolation);
    } catch (SQLException e) {
      throw new DAOException("Exception is thrown during the commit of transaction", e);
    }
  }
View Full Code Here

    try {
      sqlConnection.rollback();
      sqlConnection.setAutoCommit(true);
      sqlConnection.setTransactionIsolation(previousTransactionIsolation);
    } catch (SQLException e) {
      throw new DAOException("Exception is thrown during the rollback of transaction", e);

    }
  }
View Full Code Here

TOP

Related Classes of org.apache.stonehenge.stocktrader.dal.DAOException

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.