购物车项目
项目路径截图:
pojo:实体类
Goods.java:商品的实体类
package com.test.pojo;
public class Goods {
private Integer goodsId;
private String goodsName;
private Double goodsPrice;
private String goodsInfo;
public Integer getGoodsId() {
return goodsId;
}
public void setGoodsId(Integer goodsId) {
this.goodsId = goodsId;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public Double getGoodsPrice() {
return goodsPrice;
}
public void setGoodsPrice(Double goodsPrice) {
this.goodsPrice = goodsPrice;
}
public String getGoodsInfo() {
return goodsInfo;
}
public void setGoodsInfo(String goodsInfo) {
this.goodsInfo = goodsInfo;
}
public Goods() {
// TODO Auto-generated constructor stub
}
public Goods(Integer goodsId, String goodsName, Double goodsPrice, String goodsInfo) {
super();
this.goodsId = goodsId;
this.goodsName = goodsName;
this.goodsPrice = goodsPrice;
this.goodsInfo = goodsInfo;
}
@Override
public String toString() {
return "Goods [goodsId=" + goodsId + ", goodsName=" + goodsName + ", goodsPrice=" + goodsPrice + ", goodsInfo="
+ goodsInfo + "]";
}
}
User.java:用户的实体类
package com.test.pojo;
public class User {
private Integer userId;
private String userAccount;
private String userPwd;
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getUserAccount() {
return userAccount;
}
public void setUserAccount(String userAccount) {
this.userAccount = userAccount;
}
public String getUserPwd() {
return userPwd;
}
public void setUserPwd(String userPwd) {
this.userPwd = userPwd;
}
public User() {
// TODO Auto-generated constructor stub
}
public User(Integer userId, String userAccount, String userPwd) {
super();
this.userId = userId;
this.userAccount = userAccount;
this.userPwd = userPwd;
}
@Override
public String toString() {
return "User [userId=" + userId + ", userAccount=" + userAccount + ", userPwd=" + userPwd + "]";
}
}
util:工具包
DBHelper.java:数据库连接帮助类
package com.test.util;
/**
* 连接数据库的工具包
* @author 绥彼岸
*
*/
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.