?? 2035050bed18001e1aa3f6da0f9d7068
字號:
package com.cric.onlineshopclothes.dao;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.cric.onlineshopclothes.javabean.Customer;
import com.cric.onlineshopclothes.util.DBUtils;
public class CustomerDAO {
public List getProductList(){
DBUtils db=new DBUtils();
ResultSet rs=null;
List list=new ArrayList();
String sqlStr="select * from customer";
try{
rs=db.excuteQuery(sqlStr);
while(rs.next()){
Customer customer=new Customer();
customer.setCId(rs.getInt("pid"));
customer.setCustomerName(rs.getString("productName"));
customer.getCustomerPass(rs.getString("productDetail"));
product.setProductPrice(rs.getFloat("productPrice"));
product.setProductAmount(rs.getInt("productAmount"));
product.setProductPic(rs.getString("productPic"));
product.setProductState(rs.getInt("productState"));
list.add(product);
}
}catch(Exception e){
e.printStackTrace();
}finally{
db.closeConnection();
}
return list;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -