资源简介
可配置分页效果,可配置数据库效果(支持MySQL,SQLServer2008,Oracle),订单管理,商品信息发布,管理员,游客,注册用户,JQuery效果,base64加密,MD5.购物车,留言等
代码片段和文件信息
package cn.edu.hactcm.dao;
import java.sql.SQLException;
import java.util.List;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import cn.edu.hactcm.domain.Address;
import cn.edu.hactcm.exception.DaoException;
import cn.edu.hactcm.util.JdbcUtils;
public class AddressDao {
public List findUserAddress (String userid) {
try {
QueryRunner runner = new QueryRunner(JdbcUtils.getDataSource());
String sql = “select * from mobileshop_address where userid=?“;
List list = (List) runner.query(sql new BeanListHandler(Address.class) new object[]{userid});
return list;
} catch (SQLException e) {
throw new DaoException(e);
}
}
//添加
public boolean insert(Address address) {
try {
QueryRunner runner = new QueryRunner(JdbcUtils.getDataSource());
String sql = “insert into mobileshop_address(idaddressnamecellphonelocationuserid) values(?????)“;
int num = runner.update(sqlnew object[]{
address.getId()
address.getAddressname()
address.getCellphone()
address.getLocation()
address.getUserid()
});
if (num > 0)
return true;
return false;
} catch (SQLException e) {
throw new DaoException(e);
}
}
//根据Id 找address
public Address find(String addressid) {
try {
QueryRunner runner = new QueryRunner(JdbcUtils.getDataSource());
String sql = “select * from mobileshop_address where id=?“;
Address address = (Address) runner.query(sql new BeanHandler(Address.class)new object[]{addressid});
return address;
} catch (SQLException e) {
throw new DaoException(e);
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-03-30 00:42 mobileshop\
文件 1548 2012-02-29 15:13 mobileshop\.classpath
目录 0 2012-02-29 15:13 mobileshop\.myeclipse\
文件 303 2012-02-29 15:13 mobileshop\.myme
文件 1283 2012-02-29 15:13 mobileshop\.project
目录 0 2012-03-30 00:42 mobileshop\.settings\
文件 330 2012-02-29 15:13 mobileshop\.settings\org.eclipse.jdt.core.prefs
目录 0 2012-03-30 00:42 mobileshop\config\
文件 439 2012-02-29 15:23 mobileshop\config\c3p0-config.xm
文件 4198 2012-02-29 15:13 mobileshop\config\mobileshop.sql
文件 306 2012-02-29 15:13 mobileshop\config\numberofperpage.properties
目录 0 2012-03-30 00:42 mobileshop\src\
目录 0 2012-03-30 00:42 mobileshop\src\cn\
目录 0 2012-03-30 00:42 mobileshop\src\cn\edu\
目录 0 2012-03-30 00:42 mobileshop\src\cn\edu\hactcm\
目录 0 2012-03-30 00:42 mobileshop\src\cn\edu\hactcm\dao\
文件 1789 2012-02-29 15:13 mobileshop\src\cn\edu\hactcm\dao\AddressDao.java
文件 2424 2012-02-29 15:13 mobileshop\src\cn\edu\hactcm\dao\BrandDao.java
文件 4490 2012-02-29 15:13 mobileshop\src\cn\edu\hactcm\dao\OrderDao.java
文件 527 2012-02-29 15:13 mobileshop\src\cn\edu\hactcm\dao\PhoneDao.java
文件 5518 2012-02-29 15:13 mobileshop\src\cn\edu\hactcm\dao\PhoneDaoImpl.java
文件 2008 2012-02-29 15:13 mobileshop\src\cn\edu\hactcm\dao\UserDao.java
目录 0 2012-03-30 00:42 mobileshop\src\cn\edu\hactcm\domain\
文件 882 2012-02-29 15:13 mobileshop\src\cn\edu\hactcm\domain\Address.java
文件 400 2012-02-29 15:13 mobileshop\src\cn\edu\hactcm\domain\Brand.java
文件 1483 2012-02-29 15:13 mobileshop\src\cn\edu\hactcm\domain\Order.java
文件 1069 2012-02-29 15:13 mobileshop\src\cn\edu\hactcm\domain\OrderItem.java
文件 1311 2012-02-29 15:13 mobileshop\src\cn\edu\hactcm\domain\Page.java
文件 2542 2012-02-29 15:13 mobileshop\src\cn\edu\hactcm\domain\Phone.java
文件 729 2012-02-29 15:13 mobileshop\src\cn\edu\hactcm\domain\Shoppingcart.java
文件 656 2012-02-29 15:13 mobileshop\src\cn\edu\hactcm\domain\ShoppingcartItem.java
............此处省略245个文件信息
评论
共有 条评论