資源簡(jiǎn)介
jsp的完整購(gòu)物商城代碼,挺全的,可以作為參考

代碼片段和文件信息
package?com.wy.dao;
import?java.sql.*;
import?java.util.*;
import?com.wy.tool.JDBConnection;
import?com.wy.domain.AfficheForm;
//對(duì)公告信息的操作
public?class?AfficheDao?{
??private?Connection?connection?=?null;?//定義連接的對(duì)象
??private?PreparedStatement?ps?=?null;?//定義預(yù)準(zhǔn)備的對(duì)象
??private?JDBConnection?jdbc?=?null;?//定義數(shù)據(jù)庫(kù)連接對(duì)象
??public?AfficheDao()?{
????jdbc?=?new?JDBConnection();
????connection?=?jdbc.connection;?//利用構(gòu)造方法取得數(shù)據(jù)庫(kù)連接
??}
??//刪除的方法
??public?void?deleteAffiche(Integer?id)?{
????try?{
??????ps?=?connection.prepareStatement(“delete?from?tb_affiche?where?id=?“);
??????ps.setInt(1?id.intValue());
??????ps.executeUpdate();
??????ps.close();
????}
????catch?(SQLException?ex)?{
???? ex.printStackTrace();
????}
??}
??//修改的方法
??public?void?updateAffiche(AfficheForm?form)?{
????try?{
??????ps?=?connection.prepareStatement(“update?tb_affiche?set?name=?content=??where?id=?“);
??????ps.setString(1?form.getName());
??????ps.setString(2?form.getContent());
??????ps.setInt(3?form.getId().intValue());
??????ps.executeUpdate();
??????ps.close();
????}
????catch?(SQLException?ex)?{
???? ex.printStackTrace();
????}
??}
//添加的方法
??public?void?insertAffiche(AfficheForm?form)?{
????try?{
??????ps?=?connection.prepareStatement(“insert?into?tb_affiche?values?(null??now())“);
??????ps.setString(1?form.getName());
??????ps.setString(2?form.getContent());
??????ps.executeUpdate();
??????ps.close();
????}
????catch?(SQLException?ex)?{
???? ex.printStackTrace();
????}
??}
//以數(shù)據(jù)庫(kù)流水號(hào)為條件查詢信息
??public?AfficheForm?selectOneAffiche(Integer?id)?{
????AfficheForm?affiche?=?null;
????try?{
??????ps?=?connection.prepareStatement(“select?*?from?tb_affiche?where?id=?“);
??????ps.setInt(1?id.intValue());
??????ResultSet?rs?=?ps.executeQuery();
??????while?(rs.next())?{
????????affiche?=?new?AfficheForm();
????????affiche.setId(Integer.valueOf(rs.getString(1)));
????????affiche.setName(rs.getString(2));
????????affiche.setContent(rs.getString(3));
????????affiche.setIssueTime(rs.getString(4));
??????}
????}
????catch?(SQLException?ex)?{
???? ex.printStackTrace();
????}
????return?affiche;
??}
//全部查詢的方法
??public?List?selectAffiche()?{
????List?list?=?new?ArrayList();
????AfficheForm?affiche?=?null;
????try?{
??????ps?=?connection.prepareStatement(“select?*?from?tb_affiche?order?by?id?DESC“);
??????ResultSet?rs?=?ps.executeQuery();
??????while?(rs.next())?{
????????affiche?=?new?AfficheForm();
????????affiche.setId(Integer.valueOf(rs.getString(1)));
????????affiche.setName(rs.getString(2));
????????affiche.setContent(rs.getString(3));
????????affiche.setIssueTime(rs.getString(4));
????????list.add(affiche);
??????}
????}
????catch?(SQLException?ex)?{
???? ex.printStackTrace();
????}
????return?list;
??}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????519??2014-06-26?10:50??Shopping\.classpath
?????文件???????1257??2014-06-26?10:50??Shopping\.project
?????文件????????503??2014-06-26?10:50??Shopping\.settings\.jsdtscope
?????文件????????395??2014-06-26?10:50??Shopping\.settings\org.eclipse.jdt.core.prefs
?????文件????????454??2014-06-26?10:50??Shopping\.settings\org.eclipse.wst.common.component
?????文件????????345??2014-06-26?10:50??Shopping\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件?????????49??2014-06-26?10:50??Shopping\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件??????????6??2014-06-26?10:50??Shopping\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件???????3302??2015-04-27?21:45??Shopping\build\classes\com\wy\dao\AfficheDao.class
?????文件???????2848??2015-04-27?21:45??Shopping\build\classes\com\wy\dao\BigTypeDao.class
?????文件???????6928??2015-04-27?21:45??Shopping\build\classes\com\wy\dao\GoodsDao.class
?????文件???????2478??2015-04-27?21:45??Shopping\build\classes\com\wy\dao\li
?????文件???????3407??2015-04-27?21:45??Shopping\build\classes\com\wy\dao\ManagerDao.class
?????文件???????5168??2015-04-27?21:45??Shopping\build\classes\com\wy\dao\MemberDao.class
?????文件???????4677??2015-04-27?21:45??Shopping\build\classes\com\wy\dao\OrderDao.class
?????文件???????3018??2015-04-27?21:45??Shopping\build\classes\com\wy\dao\OrderDetailDao.class
?????文件???????4256??2015-04-27?21:45??Shopping\build\classes\com\wy\dao\SmallTypeDao.class
?????文件???????1807??2015-04-27?21:45??Shopping\build\classes\com\wy\domain\AfficheForm.class
?????文件???????1662??2015-04-27?21:45??Shopping\build\classes\com\wy\domain\BigTypeForm.class
?????文件???????3063??2015-04-27?21:45??Shopping\build\classes\com\wy\domain\GoodsForm.class
?????文件???????1444??2015-04-27?21:45??Shopping\build\classes\com\wy\domain\li
?????文件???????2049??2015-04-27?21:45??Shopping\build\classes\com\wy\domain\ManagerForm.class
?????文件???????1928??2015-04-27?21:45??Shopping\build\classes\com\wy\domain\MemberForm.class
?????文件???????1954??2015-04-27?21:45??Shopping\build\classes\com\wy\domain\OrderDetailForm.class
?????文件???????3003??2015-04-27?21:45??Shopping\build\classes\com\wy\domain\OrderForm.class
?????文件????????346??2015-04-27?21:45??Shopping\build\classes\com\wy\domain\SellGoodsForm.class
?????文件???????1872??2015-04-27?21:45??Shopping\build\classes\com\wy\domain\SmallTypeForm.class
?????文件????????647??2015-04-27?21:45??Shopping\build\classes\com\wy\tool\CountTime.class
?????文件???????1127??2015-04-27?21:46??Shopping\build\classes\com\wy\tool\JDBConnection.class
?????文件????????950??2015-04-27?21:45??Shopping\build\classes\com\wy\tool\SelfRequestProcessor.class
............此處省略242個(gè)文件信息
評(píng)論
共有 條評(píng)論