• 大小: 6.75M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-04-10
  • 语言: Java
  • 标签: Javaweb  java  web  书城  项目  

资源简介

前台、后台管理、数据库脚本都有

资源截图

代码片段和文件信息

package cn.itcast.itcaststore.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.itcast.itcaststore.domain.Notice;
import cn.itcast.itcaststore.utils.DataSourceUtils;

public class NoticeDao {
//后台系统,查询所有的公告
public List getAllNotices() throws SQLException {
String sql = “select * from notice order by n_time desc limit 010“;
QueryRunner runner = new QueryRunner(DataSourceUtils.getDataSource());
return runner.query(sql new BeanListHandler(Notice.class));
}

//后台系统,添加公告
public void addNotice(Notice n) throws SQLException {
String sql = “insert into notice(titledetailsn_time) values(???)“;
QueryRunner runner = new QueryRunner(DataSourceUtils.getDataSource());
runner.update(sql n.gettitle()n.getDetails()n.getN_time());
}

//后台系统,根据id查找公告
public Notice findNoticeById(String n_id) throws SQLException {
String sql = “select * from notice where n_id = ?“;
QueryRunner runner = new QueryRunner(DataSourceUtils.getDataSource());
return runner.query(sql new BeanHandler(Notice.class)n_id);
}

//后台系统,根据id修改单个公告
public void updateNotice(Notice n) throws SQLException {
String sql = “update notice set title=?details=?n_time=? where n_id=?“;
QueryRunner runner = new QueryRunner(DataSourceUtils.getDataSource());
runner.update(sql n.gettitle()n.getDetails()n.getN_time()n.getN_id());
}

//后台系统,根据id删除公告
public void deleteNotice(String n_id) throws SQLException {
String sql = “delete from notice where n_id = ?“;
QueryRunner runner = new QueryRunner(DataSourceUtils.getDataSource());
runner.update(sql n_id);
}

//前台系统,查询最新添加或修改的一条公告
public Notice getRecentNotice() throws SQLException {
String sql = “select * from notice order by n_time desc limit 01“;
QueryRunner runner = new QueryRunner(DataSourceUtils.getDataSource());
return runner.query(sql new BeanHandler(Notice.class));
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        983  2021-01-02 22:23  Bookcity\.classpath

     文件       1191  2020-12-17 09:57  Bookcity\.project

     文件        522  2020-12-17 09:57  Bookcity\.settings\.jsdtscope

     文件         57  2020-12-17 09:58  Bookcity\.settings\org.eclipse.core.resources.prefs

     文件        364  2020-12-17 09:57  Bookcity\.settings\org.eclipse.jdt.core.prefs

     文件        483  2020-12-17 09:57  Bookcity\.settings\org.eclipse.wst.common.component

     文件        414  2020-12-17 09:57  Bookcity\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2020-12-17 09:57  Bookcity\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2020-12-17 09:57  Bookcity\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件         66  2020-12-17 09:58  Bookcity\.tern-project

     文件      14326  2016-06-13 18:00  Bookcity\itcaststore.sql

     文件        330  2020-12-17 10:01  Bookcity\src\c3p0-config.xml

     文件       2278  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\dao\NoticeDao.java

     文件       8468  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\dao\OrderDao.java

     文件       2443  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\dao\OrderItemDao.java

     文件       8675  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\dao\ProductDao.java

     文件       1771  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\dao\UserDao.java

     文件        641  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\domain\Notice.java

     文件       2197  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\domain\Order.java

     文件        476  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\domain\OrderItem.java

     文件       1504  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\domain\PageBean.java

     文件       2505  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\domain\Product.java

     文件       2356  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\domain\User.java

     文件        460  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\exception\ActiveUserException.java

     文件        446  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\exception\AddProductException.java

     文件        471  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\exception\FindProductByIdException.java

     文件        623  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\exception\ListProductException.java

     文件        611  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\exception\LoginException.java

     文件        622  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\exception\RegisterException.java

     文件       1704  2020-12-17 09:58  Bookcity\src\cn\itcast\itcaststore\service\NoticeService.java

............此处省略559个文件信息

评论

共有 条评论