资源简介
mysql+tomcat+myeclipse,自己做的后台管理,前台是课本上的,只有3个包,适合初学者练手。麻雀虽小,五脏俱全。源代码下载,带数据库,直接可以import到myeclipse里。在bookstore.DBAccess.java中改数据库密码就可以了。如何你没有按myeclipse也没有关系,你只需把WebRoot里面的东西考到tomcat下的webapps目录下bookstores文件夹里。我的数据库用户名:root,密码:12345
代码片段和文件信息
package bookstore.bean;
import java.sql.Blob; //
import java.sql.Connection; //
import java.sql.PreparedStatement ; //
import java.sql.SQLException; //
import java.sql.Statement; //
import java.util.Vector;
import org.apache.log4j.*;
import bookstore.model.DBAccess;
public class BookBean {
public Logger log = Logger.getLogger(this.getClass().getName());
private int bookId = 0;
private int sortId = 0;
private String bookName = “dd“;
private double price = 0.0;
private double salePrice = 90000.0;
private String bookDesc = null;
private String author = null;
private String image = null;
private String publish = null;
private String join_date = null;
public BookBean() {
}
public void setBookId(int bookId) {
this.bookId = bookId;
}
public int getBookId() {
return this.bookId;
}
public void setSortId(int sortId) {
this.sortId = sortId;
}
public int getSortId() {
return this.sortId;
}
public void setBookName(String bookName) {
this.bookName = bookName;
}
public String getBookName() {
return this.bookName;
}
public void setPrice(double price) {
this.price = price;
}
public double getPrice() {
return this.price;
}
public void setSalePrice(double salePrice) {
this.salePrice = salePrice;
}
public double getSalePrice() {
return this.salePrice;
}
public void setBookDesc(String bookDesc) {
this.bookDesc = bookDesc;
}
public String getBookDesc() {
return this.bookDesc;
}
public void setAuthor(String author) {
this.author = author;
}
public String getAuthor() {
return this.author;
}
public void setImage(String image) {
this.image = image;
}
public String getImage() {
return this.image;
}
public void setPublish(String publish) {
this.publish = publish;
}
public String getPublish() {
return this.publish;
}
public void setJoinDate(String join_date) { //出版时间
this.join_date = join_date;
}
public String getJoinDate() {
return this.join_date;
}
/**
* 通过种类查询图书的方法
*
* @param sortId
* 图书种类Id
* @return
*/
public Vector bookQuery(String sortId) {
String strSql;
Vector vecBook = null;
String[][] strTemp = null;
DBAccess dba = new DBAccess();
strSql = “select * from book_info where sort_id=‘“ + sortId + “‘“;
System.out.println(“strSql:“ + strSql);
strTemp = dba.Query(strSql);
if (strTemp != null && strTemp.length > 0) {
vecBook = new Vector();
for (int i = 0; i < strTemp.length; i++) {
BookBean bookBean = new BookBean();
bookBean.setBookId((new Integer(strTemp[i][0].trim()))
.intValue());
bookBean.setSortId((new Integer(strTemp[i][1].trim()))
.intValue());
bookBean.setBookName(strTemp[i][2]);
bookBean.setPrice(new Double(strTemp[i][3].trim()).doubleValue());
bookBean.se
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 849 2012-05-05 09:55 bookstores\.classpath
文件 876 2012-05-07 16:07 bookstores\.myeclipse\profiler\bookstores on Tomcat 6.x.xm
文件 303 2012-06-07 23:43 bookstores\.myme
文件 1416 2012-05-05 10:10 bookstores\.project
文件 500 2012-05-05 09:48 bookstores\.settings\.jsdtscope
文件 330 2012-05-05 09:48 bookstores\.settings\org.eclipse.jdt.core.prefs
文件 49 2012-05-05 09:48 bookstores\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2012-05-05 09:48 bookstores\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 2873 2012-06-08 00:05 bookstores\bookstore.sql
文件 13216 2012-06-08 09:32 bookstores\src\bookstore\bean\BookBean.java
文件 4439 2012-06-06 17:44 bookstores\src\bookstore\bean\BookSort.java
文件 3798 2012-06-04 21:21 bookstores\src\bookstore\bean\OrderBean.java
文件 2044 2012-06-04 21:21 bookstores\src\bookstore\bean\ShopCartBean.java
文件 7531 2012-06-06 20:45 bookstores\src\bookstore\bean\UserBean.java
文件 15152 2012-06-04 21:21 bookstores\src\bookstore\model\DBAccess.java
文件 3797 2012-06-04 21:21 bookstores\src\bookstore\servlet\InitServlet.java
文件 841 2012-06-06 21:41 bookstores\WebRoot\addBookContent.jsp
文件 852 2012-05-05 09:50 bookstores\WebRoot\addCart.jsp
文件 831 2012-06-06 21:41 bookstores\WebRoot\bottom.jsp
文件 1116 2012-05-05 09:50 bookstores\WebRoot\checkLogin.jsp
文件 1104 2012-06-06 20:44 bookstores\WebRoot\checkReg.jsp
文件 3588 2012-06-06 22:11 bookstores\WebRoot\createOrder.jsp
文件 1348 2012-05-05 09:50 bookstores\WebRoot\delBook.jsp
文件 1237 2012-05-05 09:50 bookstores\WebRoot\emptycart.jsp
文件 832 2012-06-06 21:43 bookstores\WebRoot\error.jsp
文件 1236 2012-06-06 18:35 bookstores\WebRoot\fr
文件 1514 2012-05-05 09:50 bookstores\WebRoot\header.jsp
文件 843 2012-06-06 21:43 bookstores\WebRoot\historyOrder.jsp
文件 2177 2012-05-05 09:57 bookstores\WebRoot\images\00-1.gif
文件 2144 2012-05-05 09:57 bookstores\WebRoot\images\00-2.gif
............此处省略121个文件信息
- 上一篇:android 电子书255168
- 下一篇:Android五子棋255189
评论
共有 条评论