• 大小: 1.09MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-03
  • 语言: Java
  • 标签: servlet  jsp  

资源简介

这个是个人写的基于servlet和jsp的个人二手平台交易系统,大量留有后续接口,设计十分简单,明了非常适合新手参考理解。 本web设计采用了Derby数据库,请使用着直接导入即可使用

资源截图

代码片段和文件信息

package action;

import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import utils.DBManager;
import databeans.Goods;

public class MarketAction {
public List showMarket(){
List list=new ArrayList();

String sql=“select * from app.goods“;
Connection connection=null;
ResultSet rs=null;
Statement stmt=null;
connection=DBManager.getConnection();
try {
stmt=connection.createStatement();
rs=stmt.executeQuery(sql);
while(rs.next()){
Goods goods=new Goods();
goods.setGoodsid(rs.getLong(“goodsid“));
goods.setGoodsname(rs.getString(“goodsname“));
goods.setPrice(rs.getLong(“price“));
goods.setQuantity(rs.getShort(“quantity“));
goods.setUsername(rs.getString(“username“));
list.add(goods);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return list;

}
public List showGoods( String name){
List list =new ArrayList();

Connection connection=null;
Statement stmt=null;
ResultSet rs=null;
String sql=“select * from app.goods where username =‘“+name+“‘“;
connection=DBManager.getConnection();
try {
stmt=connection.createStatement();
rs=stmt.executeQuery(sql);
while(rs.next()){
Goods goods=new Goods();
goods.setGoodsid(rs.getLong(“goodsid“));
goods.setGoodsname(rs.getString(“goodsname“));
goods.setPrice(rs.getLong(“price“));
goods.setQuantity(rs.getShort(“quantity“));
list.add(goods);
}

} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

return list;
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        1633  2014-08-23 16:03  Derby Database.derby
     目录           0  2014-08-23 16:04  SecondGoodsTranstaction\
     文件        1140  2014-08-23 16:04  SecondGoodsTranstaction\.classpath
     文件        1348  2014-08-23 16:04  SecondGoodsTranstaction\.project
     目录           0  2014-08-23 16:04  SecondGoodsTranstaction\.settings\
     文件         522  2014-08-23 16:04  SecondGoodsTranstaction\.settings\.jsdtscope
     文件        1009  2014-08-23 16:04  SecondGoodsTranstaction\.settings\com.genuitec.eclipse.j2eedt.core.prefs
     文件         364  2014-08-23 16:04  SecondGoodsTranstaction\.settings\org.eclipse.jdt.core.prefs
     文件         529  2014-08-23 16:04  SecondGoodsTranstaction\.settings\org.eclipse.wst.common.component
     文件         398  2014-08-23 16:04  SecondGoodsTranstaction\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2014-08-23 16:04  SecondGoodsTranstaction\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2014-08-23 16:04  SecondGoodsTranstaction\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\
     目录           0  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\meta-INF\
     文件          39  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\meta-INF\MANIFEST.MF
     目录           0  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\
     目录           0  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\classes\
     目录           0  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\classes\action\
     文件        2730  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\classes\action\MarketAction.class
     文件        8820  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\classes\action\UserAction.class
     目录           0  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\classes\databeans\
     文件        1323  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\classes\databeans\Goods.class
     文件        1670  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\classes\databeans\User.class
     目录           0  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\classes\filiter\
     文件        1325  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\classes\filiter\setCharacter.class
     目录           0  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\classes\servlets\
     文件        2261  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\classes\servlets\ShowMarket.class
     文件        2421  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\classes\servlets\ShowUserGoods.class
     文件        1281  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\classes\servlets\abandon.class
     文件        2802  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\classes\servlets\addGoods.class
     文件        2521  2014-08-23 16:04  SecondGoodsTranstaction\WebRoot\WEB-INF\classes\servlets\deleteGoods.class
............此处省略67个文件信息

评论

共有 条评论