资源简介
根据需求分析文档,完成在线鞋城的浏览、添加购物车、删除购物车、以及结账等功能
代码片段和文件信息
package com.dao;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Types;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import oracle.jdbc.driver.OracleTypes;
import com.dao.iface.ProductDaoIface;
import com.domain.Product;
import com.domain.Slider;
import com.util.Dbconnection;
public class ProductDao implements ProductDaoIface{
@Override
public Map queryAllCategory() {
// TODO Auto-generated method stub
Connection conn = Dbconnection.getConn();
CallableStatement cs = null;
ResultSet rs = null;
Map map = new HashMap();
try {
cs = conn.prepareCall(“{call pa_categroy.pro_categroy_query(??)}“);
cs.registerOutParameter(1 OracleTypes.CURSOR);
cs.registerOutParameter(2 Types.NUMERIC);
cs.execute();
int result = cs.getInt(2);
if(result == 1){
rs = (ResultSet)cs.getobject(1);
while(rs.next()){
int id = rs.getInt(1);
String name = rs.getString(2);
map.put(id name);
}
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
Dbconnection.close(rs cs conn);
}
return map;
}
@Override
public List searchNewProduct(String sql) {
Connection conn = Dbconnection.getConn();
Statement st = null;
ResultSet rs = null;
List list = new ArrayList();
try {
st = conn.createStatement();
rs = st.executeQuery(sql);
while(rs.next()){
Integer productId = rs.getInt(“PRODUCT_ID“);
String description = rs.getString(“DEscriptION“);
double price = rs.getDouble(“PRICE“);
String model = rs.getString(“MODEL“);
String feature = rs.getString(“FEATURE“);
String imgpath = rs.getString(“IMGPATH“);
int novaltystatus = rs.getInt(“NOVALTY_STATUS“);
Date publishDate = rs.getDate(“PUBLISH_DATE“);
int categoryId = rs.getInt(“CATEGORY_ID“);
Product product = new Product(productId description price model feature imgpath novaltystatus publishDate categoryId);
list.add(product);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return list;
}
@Override
public List searchHotProduct(String sql) {
// TODO Auto-generated method stub
Connection conn = Dbconnection.getConn();
Statement st = null;
ResultSet rs = null;
List list = new ArrayList();
try {
st = conn.createStatement();
rs = st.executeQuery(sql);
while(rs.next()){
Integer productId = rs.getInt(“PRODUCT_ID“);
String description = rs.getString(“DEscript
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 834 2018-09-02 15:56 实践项目2\shoeStore\.classpath
文件 1042 2018-09-02 15:56 实践项目2\shoeStore\.project
文件 503 2018-09-02 15:56 实践项目2\shoeStore\.settings\.jsdtscope
文件 364 2018-09-02 15:56 实践项目2\shoeStore\.settings\org.eclipse.jdt.core.prefs
文件 479 2018-09-02 15:56 实践项目2\shoeStore\.settings\org.eclipse.wst.common.component
文件 345 2018-09-02 15:56 实践项目2\shoeStore\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2018-09-02 15:56 实践项目2\shoeStore\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2018-09-02 15:56 实践项目2\shoeStore\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 950 2018-09-04 18:43 实践项目2\shoeStore\build\classes\com\dao\iface\ProductDaoIface.class
文件 1286 2018-09-08 10:38 实践项目2\shoeStore\build\classes\com\dao\iface\ShopDaoIface.class
文件 219 2018-09-02 22:38 实践项目2\shoeStore\build\classes\com\dao\iface\UserDaoIface.class
文件 9054 2018-09-04 18:52 实践项目2\shoeStore\build\classes\com\dao\ProductDao.class
文件 11073 2018-09-10 16:25 实践项目2\shoeStore\build\classes\com\dao\ShopDao.class
文件 2176 2018-09-02 22:42 实践项目2\shoeStore\build\classes\com\dao\UserDao.class
文件 3213 2018-09-07 12:56 实践项目2\shoeStore\build\classes\com\domain\detail.class
文件 1017 2018-09-07 21:14 实践项目2\shoeStore\build\classes\com\domain\OrderDetatil.class
文件 1086 2018-09-10 16:25 实践项目2\shoeStore\build\classes\com\domain\Orderlist.class
文件 3948 2018-09-10 16:22 实践项目2\shoeStore\build\classes\com\domain\OrderListDetail.class
文件 3309 2018-09-04 16:33 实践项目2\shoeStore\build\classes\com\domain\Product.class
文件 2648 2018-09-04 21:05 实践项目2\shoeStore\build\classes\com\domain\ShopCar.class
文件 1660 2018-09-03 21:31 实践项目2\shoeStore\build\classes\com\domain\Slider.class
文件 1077 2018-09-02 22:28 实践项目2\shoeStore\build\classes\com\domain\User.class
文件 2428 2018-09-08 16:28 实践项目2\shoeStore\build\classes\com\filter\LoginFilter.class
文件 804 2018-09-08 15:35 实践项目2\shoeStore\build\classes\com\service\iface\ProductIface.class
文件 1037 2018-09-08 10:37 实践项目2\shoeStore\build\classes\com\service\iface\ShoppingIface.class
文件 213 2018-09-02 22:38 实践项目2\shoeStore\build\classes\com\service\iface\UserServiceIface.class
文件 4440 2018-09-08 15:33 实践项目2\shoeStore\build\classes\com\service\ProductService.class
文件 4878 2018-09-10 16:20 实践项目2\shoeStore\build\classes\com\service\ShoppingService.class
文件 1567 2018-09-02 22:43 实践项目2\shoeStore\build\classes\com\service\UserService.class
文件 2264 2018-09-04 14:05 实践项目2\shoeStore\build\classes\com\servlet\BeginServlet.class
............此处省略457个文件信息
- 上一篇:海颐特权账号安全管理系统
- 下一篇:FEKO资料.rar
评论
共有 条评论