資源簡介
這是一個在線鞋城的購鞋網站的項目。主要功能是用戶登錄/查詢產品/產品分頁/添加購物車/刪除購物車/訂單管理/基礎的Ajax運用等

代碼片段和文件信息
package?com.dao;
import?java.sql.Connection;
import?java.sql.PreparedStatement;
import?java.sql.ResultSet;
import?java.sql.SQLException;
import?java.util.ArrayList;
import?java.util.Date;
import?java.util.List;
import?com.dao.iface.OrderDaoIface;
import?com.domain.Order;
import?com.domain.OrderList;
import?com.domain.Product;
import?com.util.DbConnection;
public?class?OrderDao?implements?OrderDaoIface{
@Override
public?int?count(String?sql?String?userId)?{
int?result?=?0;
Connection?conn?=?null;
PreparedStatement?ps?=?null;
ResultSet?rs?=?null;
conn?=?DbConnection.getConnection();
try?{
ps?=?conn.prepareStatement(sql);
ps.setString(1?userId);
rs?=?ps.executeQuery();
if(rs.next()){
result?=?rs.getInt(1);
}
}?catch?(SQLException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}finally{
DbConnection.close(rs?ps?conn);
}
return?result;
}
@Override
public?List?pagingById(String?sql?String?userIdint?begin?int??end)?{
List?orderList?=?new?ArrayList();
Connection?conn?=?null;
PreparedStatement?ps?=?null;
ResultSet?rs?=?null;
conn?=?DbConnection.getConnection();
try?{
ps?=?conn.prepareStatement(sql);
ps.setString(1?userId);
ps.setInt(2?begin);
ps.setInt(3?end);
rs?=?ps.executeQuery();
while(rs.next()){
int?orderId?=?rs.getInt(“order_id“);
Date?createTime?=?rs.getTimestamp(“CREATE_TIME“);
System.out.println(createTime);
Double?amount?=?rs.getDouble(“amount“);
Order?order?=?new?Order();
order.setOrderId(orderId);
order.setCreateTime(createTime);
order.setAmount(amount);
orderList.add(order);
}
}?catch?(SQLException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}finally{
DbConnection.close(rs?ps?conn);
}
return?orderList;
}
@Override
public?Order?queryOrder(String?sql?int?orderId)?{
Order?order?=?null;
Connection?conn?=?null;
PreparedStatement?ps?=?null;
ResultSet??rs?=?null;
//String?sql?=?“SELECT?empno?ename?job?sal?FROM?emp?WHERE?empno?=??“;
try?{
conn?=?DbConnection.getConnection();
ps?=?conn.prepareStatement(sql);
ps.setInt(1?orderId);
rs?=?ps.executeQuery();
if?(rs.next()){
int?orderId1?=?rs.getInt(“ORDER_ID“);
Date?createTime?=?rs.getDate(“CREATE_TIME“);
Double?amount?=?rs.getDouble(“AMOUNT“);
String?payment?=?rs.getString(“PAYMENT“);
String?receiver?=?rs.getString(“RECEIVER“);
String?province?=?rs.getString(“PROVINCE“);
String?city?=?rs.getString(“CITY“);
String?county?=?rs.getString(“COUNTY“);
String?address?=?rs.getString(“ADDRESS“);
String?zipCode?=?rs.getString(“ZIPCODE“);
String?telephone?=?rs.getString(“TELPHONE“);
String?userId?=?rs.getString(“USER_ID“);
order=?new?Order(orderId1createTimeamountpaymentreceiverprovincecitycountyaddresszi
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????834??2018-09-03?13:35??Shopstore\ShoesShop1\.classpath
?????文件???????1043??2018-09-03?13:35??Shopstore\ShoesShop1\.project
?????文件????????503??2018-09-03?13:35??Shopstore\ShoesShop1\.settings\.jsdtscope
?????文件????????364??2018-09-03?13:35??Shopstore\ShoesShop1\.settings\org.eclipse.jdt.core.prefs
?????文件????????482??2018-09-03?13:35??Shopstore\ShoesShop1\.settings\org.eclipse.wst.common.component
?????文件????????345??2018-09-03?13:35??Shopstore\ShoesShop1\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件?????????49??2018-09-03?13:35??Shopstore\ShoesShop1\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件??????????6??2018-09-03?13:35??Shopstore\ShoesShop1\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件????????627??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\dao\iface\OrderDaoIface.class
?????文件????????990??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\dao\iface\ProductDaoIface.class
?????文件????????667??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\dao\iface\ShoppingCartDaoIface.class
?????文件????????219??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\dao\iface\UserDaoIface.class
?????文件???????6696??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\dao\OrderDao.class
?????文件???????9274??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\dao\ProductDao.class
?????文件???????5416??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\dao\ShoppingCartDao.class
?????文件???????1536??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\dao\UserDao.class
?????文件????????942??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\domain\Category.class
?????文件???????3353??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\domain\Order.class
?????文件????????797??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\domain\OrderList.class
?????文件???????3959??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\domain\Product.class
?????文件???????2211??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\domain\ShoppingCart.class
?????文件???????1660??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\domain\Slider.class
?????文件???????1134??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\domain\User.class
?????文件???????1663??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\filter\LoginFilter.class
?????文件????????513??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\service\iface\OrderServiceIface.class
?????文件????????798??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\service\iface\ProductIface.class
?????文件????????557??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\service\iface\ShoppingCartIface.class
?????文件????????213??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\service\iface\UserServiceIface.class
?????文件???????2255??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\service\OrderService.class
?????文件???????5083??2018-09-27?16:39??Shopstore\ShoesShop1\build\classes\com\service\ProductService.class
............此處省略466個文件信息
- 上一篇:HyperMesh從入門到精通-配套光盤
- 下一篇:票據通6.2.7免狗補丁
評論
共有 條評論