gainers = sqlConnection.prepareStatement(SQL_SELECT_MARKETSUMMARY_GAINERS);
ResultSet rs = gainers.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));
topGainers.add(quote);
}
} finally {
try {
rs.close();
} 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),