Package org.xulfaces.rubis.admin.dao

Examples of org.xulfaces.rubis.admin.dao.UserDAO


    return items;
  }


  public Collection<Item> getItemsForCategory(Category category) {
    UserDAO userDAO = null;
    try {
      userDAO = new JDBCUserDAO();
    } catch (Exception e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    }
    Collection<Item> items = new ArrayList<Item>();

    StringBuffer sqlBuffer = new StringBuffer();
    sqlBuffer.append("SELECT * FROM items WHERE CATEGORY=");
    sqlBuffer.append(category.getId());
    ResultSet resultSet = null;
    try {
      resultSet = excecuteScrollableQuery(sqlBuffer.toString());
      while (resultSet.next()) {
        Item item = new Item();
        item.setId(new Integer(resultSet.getInt("ID")));
        item.setName(resultSet.getString("NAME"));     
        try {
          item.setSeller(userDAO.loadUser(new Integer(resultSet.getInt("SELLER"))));
        } catch (UserNotFoundException e) {         
          e.printStackTrace();
        }
        item.setCategory(category);
        item.setBuyNow(resultSet.getFloat("BUY_NOW"));
View Full Code Here

TOP

Related Classes of org.xulfaces.rubis.admin.dao.UserDAO

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.