Package com.dev.trade.bo

Examples of com.dev.trade.bo.Stock


    List stocks = new ArrayList();
    try {
      String query = "select A.quantity,A.stockid,B.name,B.price from TradingAccount A,stocks B where A.userid = ? and A.stockid = B.id";
      PreparedStatement pStmt = con.prepareStatement(query);
      pStmt.setString(1, userId);
      Stock stock = null;
      ResultSet rs = pStmt.executeQuery();
      while (rs.next()) {
        stock = new Stock(rs.getString(2), rs.getString(3), rs
            .getFloat(4), rs.getInt(1));
        stocks.add(stock);
      }
      pStmt.close();
    } catch (SQLException ex) {
View Full Code Here


    List stocks = new ArrayList();
    try {
      String query = "select * from stocks";
      PreparedStatement pStmt = con.prepareStatement(query);

      Stock stock = null;
      ResultSet rs = pStmt.executeQuery();
      while (rs.next()) {
        stock = new Stock(rs.getString(1), rs.getString(2), rs
            .getFloat(3), 0);
        stocks.add(stock);
      }
      pStmt.close();
    } catch (SQLException ex) {
View Full Code Here

TOP

Related Classes of com.dev.trade.bo.Stock

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.