xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡介

這時(shí)一個(gè)農(nóng)產(chǎn)品銷售平臺。并沒有用框架。但是基本的功能都有。而且我是用MyEclipse做的。如果你要使用eclipse導(dǎo)入的話,建議你在eclipse上新建一個(gè)項(xiàng)目,然后對位粘貼上去。這個(gè)項(xiàng)目中我是分為普通用戶登陸的頁面和管理員后臺登陸的頁面。

資源截圖

代碼片段和文件信息

package?cn.itcast.bookstore.book.dao;

import?java.sql.SQLException;
import?java.util.List;
import?java.util.Map;

import?org.apache.commons.dbutils.QueryRunner;
import?org.apache.commons.dbutils.handlers.BeanListHandler;
import?org.apache.commons.dbutils.handlers.MapHandler;
import?org.apache.commons.dbutils.handlers.ScalarHandler;

import?cn.itcast.bookstore.book.domain.Book;
import?cn.itcast.bookstore.category.domain.Category;
import?cn.itcast.commons.CommonUtils;
import?cn.itcast.jdbc.TxQueryRunner;

public?class?BookDao?{
private?QueryRunner?qr?=?new?TxQueryRunner();

/**
?*?查詢所有圖書
?*?@return
?*/
public?List?findAll()?{
try?{
String?sql?=?“select?*?from?book?“;
return?qr.query(sql?new?BeanListHandler(Book.class));
}?catch(SQLException?e)?{
throw?new?RuntimeException(e);
}
}

/**
?*?按分類查詢
?*?@param?cid
?*?@return
?*/
public?List?findByCategory(String?cid)?{
try?{
String?sql?=?“select?*?from?book?where?cid=??“;
return?qr.query(sql?new?BeanListHandler(Book.class)?cid);
}?catch(SQLException?e)?{
throw?new?RuntimeException(e);
}
}

/**
?*?加載方法
?*?@param?bid
?*?@return
?*/
public?Book?findByBid(String?bid)?{
try?{
/*
?*?我們需要在Book對象中保存Category的信息
?*/
String?sql?=?“select?*?from?book?where?bid=?“;
Mapject>?map?=?qr.query(sql?new?MapHandler()?bid);
/*
?*?使用一個(gè)Map,映射出兩個(gè)對象,再給這兩個(gè)對象建立關(guān)系!
?*/
Category?category?=?CommonUtils.toBean(map?Category.class);
Book?book?=?CommonUtils.toBean(map?Book.class);
book.setCategory(category);
return?book;
}?catch(SQLException?e)?{
throw?new?RuntimeException(e);
}
}

/**
?*?查詢指定分類下的圖書本數(shù)
?*?@param?cid
?*?@return
?*/
public?int?getCountByCid(String?cid)?{
try?{
String?sql?=?“select?count(*)?from?book?where?cid=?“;
Number?cnt?=?(Number)qr.query(sql?new?ScalarHandler()?cid);
return?cnt.intValue();
}?catch(SQLException?e)?{
throw?new?RuntimeException(e);
}
}

/**
?*?添加圖書
?*?@param?book
?*/
public?void?add(Book?book)?{
try?{
String?sql?=?“insert?into?book?values(??????)“;
object[]?params?=?{book.getBid()?book.getBname()?book.getPrice()
book.getAuthor()?book.getImage()?book.getCategory().getCid()};
qr.update(sql?params);
}?catch(SQLException?e)?{
throw?new?RuntimeException(e);
}
}

/**
?*?刪除圖書
?*?@param?bid
?*/
public?void?delete(String?bid)?{
try?{
String?sql?=?“delete??from??book??where?bid=?“;
qr.update(sql?bid);
}?catch(SQLException?e)?{
throw?new?RuntimeException(e);
}
}

public?void?edit(Book?book)?{
try?{
String?sql?=?“update?book?set?bname=??price=?author=??image=??cid=??where?bid=?“;
object[]?params?=?{book.getBname()?book.getPrice()
book.getAuthor()?book.getImage()?
book.getCategory().getCid()?book.getBid()};
qr.update(sql?params);
}?catch(SQLExc

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件?????????581??2018-11-21?20:22??項(xiàng)目+數(shù)據(jù)庫\bookstore\src\c3p0-config.xml
?????文件?????????958??2018-11-21?20:21??項(xiàng)目+數(shù)據(jù)庫\使用時(shí)解釋.txt
?????目錄???????????0??2018-11-16?19:31??項(xiàng)目+數(shù)據(jù)庫\
?????目錄???????????0??2018-11-16?08:24??項(xiàng)目+數(shù)據(jù)庫\bookstore\
?????文件????????2794??2018-11-16?08:46??項(xiàng)目+數(shù)據(jù)庫\bookstore\.classpath
?????目錄???????????0??2018-11-16?19:42??項(xiàng)目+數(shù)據(jù)庫\bookstore\.myeclipse\
?????文件?????????300??2014-07-21?10:27??項(xiàng)目+數(shù)據(jù)庫\bookstore\.mymetadata
?????文件????????1752??2014-07-21?10:28??項(xiàng)目+數(shù)據(jù)庫\bookstore\.project
?????目錄???????????0??2018-11-16?08:28??項(xiàng)目+數(shù)據(jù)庫\bookstore\.settings\
?????文件?????????500??2014-07-21?10:27??項(xiàng)目+數(shù)據(jù)庫\bookstore\.settings\.jsdtscope
?????文件?????????183??2014-07-24?11:52??項(xiàng)目+數(shù)據(jù)庫\bookstore\.settings\com.genuitec.eclipse.core.prefs
?????文件?????????247??2018-11-16?08:28??項(xiàng)目+數(shù)據(jù)庫\bookstore\.settings\com.genuitec.eclipse.migration.prefs
?????文件?????????395??2014-07-21?10:27??項(xiàng)目+數(shù)據(jù)庫\bookstore\.settings\org.eclipse.jdt.core.prefs
?????文件?????????553??2018-11-16?08:28??項(xiàng)目+數(shù)據(jù)庫\bookstore\.settings\org.eclipse.wst.common.component
?????文件?????????359??2018-11-16?08:28??項(xiàng)目+數(shù)據(jù)庫\bookstore\.settings\org.eclipse.wst.common.project.facet.core.xml
?????文件??????????49??2014-07-21?10:27??項(xiàng)目+數(shù)據(jù)庫\bookstore\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2014-07-21?10:27??項(xiàng)目+數(shù)據(jù)庫\bookstore\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????目錄???????????0??2018-11-16?19:31??項(xiàng)目+數(shù)據(jù)庫\bookstore\WebRoot\
?????目錄???????????0??2018-11-16?08:24??項(xiàng)目+數(shù)據(jù)庫\bookstore\WebRoot\meta-INF\
?????文件??????????36??2014-07-21?10:28??項(xiàng)目+數(shù)據(jù)庫\bookstore\WebRoot\meta-INF\MANIFEST.MF
?????目錄???????????0??2018-11-16?08:24??項(xiàng)目+數(shù)據(jù)庫\bookstore\WebRoot\WEB-INF\
?????目錄???????????0??2018-11-16?16:38??項(xiàng)目+數(shù)據(jù)庫\bookstore\WebRoot\WEB-INF\classes\
?????目錄???????????0??2018-11-16?16:38??項(xiàng)目+數(shù)據(jù)庫\bookstore\WebRoot\WEB-INF\classes\meta-INF\
?????文件??????????25??2018-11-16?08:28??項(xiàng)目+數(shù)據(jù)庫\bookstore\WebRoot\WEB-INF\classes\meta-INF\MANIFEST.MF
?????文件?????????554??2018-11-16?11:18??項(xiàng)目+數(shù)據(jù)庫\bookstore\WebRoot\WEB-INF\classes\c3p0-config.xml
?????目錄???????????0??2018-11-16?16:38??項(xiàng)目+數(shù)據(jù)庫\bookstore\WebRoot\WEB-INF\classes\cn\
?????目錄???????????0??2018-11-16?16:38??項(xiàng)目+數(shù)據(jù)庫\bookstore\WebRoot\WEB-INF\classes\cn\itcast\
?????目錄???????????0??2018-11-16?16:38??項(xiàng)目+數(shù)據(jù)庫\bookstore\WebRoot\WEB-INF\classes\cn\itcast\bookstore\
?????目錄???????????0??2018-11-16?16:38??項(xiàng)目+數(shù)據(jù)庫\bookstore\WebRoot\WEB-INF\classes\cn\itcast\bookstore\book\
?????目錄???????????0??2018-11-16?16:38??項(xiàng)目+數(shù)據(jù)庫\bookstore\WebRoot\WEB-INF\classes\cn\itcast\bookstore\book\dao\
?????文件????????4119??2018-11-16?16:38??項(xiàng)目+數(shù)據(jù)庫\bookstore\WebRoot\WEB-INF\classes\cn\itcast\bookstore\book\dao\BookDao.class
............此處省略250個(gè)文件信息

評論

共有 條評論

相關(guān)資源