?? cartbo.java
字號:
package test.bo;
import java.util.*;
import java.sql.*;
import test.db.*;
import test.models.*;
public class CartBO {
public CartBO() {
}
public Collection searchItem(String strSql){
Collection ret = new ArrayList();
try {
DBAccess dba = new DBAccess();
ResultSet rs = dba.openSelect(strSql);
while (rs.next()) {
Item temp = new Item();
temp.setItemId(rs.getString("itemid"));
temp.setProductId(rs.getString("productid"));
// Product product=new Product();
// temp.setProduct(product);
temp.getProduct().setName(rs.getString("name"));
temp.setListPrice(rs.getBigDecimal("listprice"));
temp.setUnitCost(rs.getBigDecimal("unitcost"));
temp.setSupplier(rs.getString("supplier"));
ret.add(temp);
}
}
catch (Exception ex) {
ex.printStackTrace();
}
return ret;
}
public Item getCartItem(String strSql){
Item item=new Item();
try
{
DBAccess dba = new DBAccess();
ResultSet rs = dba.openSelect(strSql);
while(rs.next())
{
item.setItemId(rs.getString("itemid"));
item.setProductId(rs.getString("productid"));
item.setListPrice(rs.getBigDecimal("listprice"));
item.setSupplier(rs.getString("supplier"));
item.setStatus(rs.getString("status"));
item.setAttribute1(rs.getString("attr1"));
item.setAttribute2(rs.getString("attr2"));
item.setAttribute3(rs.getString("attr3"));
item.setAttribute4(rs.getString("attr4"));
item.setAttribute5(rs.getString("attr5"));
item.getProduct().setName(rs.getString("name"));
item.getProduct().setProductId(rs.getString("productid"));
}
}
catch(Exception e)
{
e.printStackTrace();
}
return item;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -