资源简介
这是一个在线鞋城的购鞋网站的项目。主要功能是用户登录/查询产品/产品分页/添加购物车/删除购物车/订单管理/基础的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免狗补丁
相关资源
- org.eclipse.swt包
- eclipse 开发桌面程序
- The Art of Debugging with GDB DDD and Eclipse.
- Eclipse插件之randoop
- MyBatis_Generator MyEclipse插件离线安装包
- eclipse_mars_zh汉化包
- eclipse安装extjs插件
- MyEclipse2017 2018通用汉化包
- Navicat_Keygen_Patch_By_DFoX.zip
- 使用MyEclipse实现MapReduce
- myeclipse2016Stable1.0.rar
- Eclipse QQ第三方登录 demo
- ilg.gnuarmeclipse.repository-2.5.1-20141219151
- 哥俩好信息管理系统,可以直接导入
- myeclipse10.5破解&汉化
- my eclipse10汉化
- mybatis-generator eclipse插件离线安装包
- eclipseme.feature_1.7.9_site.zip
- MyEclipse-2017_CI_10破解文件及方法
- CKEditor配置好的MyEclipse
- 基于eclipse的简易安卓拨号程序实验
- 用myeclipse实现的BBS论坛源码
- myeclipse 2018.9.0汉化文件
- eclipse4.4 jadclipse插件
- Jadclipse For Eclipse 4.x
- vm格式文件eclipse插件
- myEclipse背景控制插件方案
- myeclipse 2017 ci 1 windows版本 破解文件
- Eclipse Oxygen.3完整汉化包
- Eclipse_RCP_应用(完整的)
评论
共有 条评论