• 大小: 3.59MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-04
  • 语言: 其他
  • 标签: 购物网站  

资源简介

简单购物网站的源代码,有基本的功能,学习网站开发可以下载参考

资源截图

代码片段和文件信息

package com.zyl.www.basedao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class baseDao {

public Connection conn = null;
public PreparedStatement pstmt = null;
public ResultSet rs = null;

//1.获取连接的方法
public Connection getConn(){
try {
Class.forName(“com.mysql.jdbc.Driver“);
//Class.forName(“oracle.jdbc.driver.OracleDriver“);
//conn = DriverManager.getConnection(“jdbc:oracle:thin:@localhost:1521:orcl“ “maket“ “xzjy2016“);
conn = DriverManager.getConnection(“jdbc:mysql://localhost:3306/chap2““root““231551“);
} catch (Exception e) {
e.printStackTrace();
}
return conn;
}
//2.实现通用的查询方法
public ResultSet getQuery(String sqlobject[] objs){


try {
conn = this.getConn();
pstmt = conn.prepareStatement(sql);

for(int i = 0;i pstmt.setobject(i+1 objs[i]);
}

rs = pstmt.executeQuery();

} catch (SQLException e) {
e.printStackTrace();
}

return rs;

}
//3.实现通用的增删改的方法
public int update(String sqlobject[] objs){
int row  = 0;
try {
conn = this.getConn();
pstmt = conn.prepareStatement(sql);

for(int i = 0;i pstmt.setobject(i+1 objs[i]);
}
row = pstmt.executeUpdate();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return row;
}
//4.关闭资源的方法
public void close(){
try{
if(rs != null){
rs.close();
}
if(pstmt != null){
pstmt.close();
}
if(conn != null){
conn.close();
}
}catch(Exception ex){
ex.printStackTrace();
}

}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-11-12 16:32  supermarket\
     文件         727  2018-11-12 16:12  supermarket\.classpath
     文件         911  2018-11-12 16:12  supermarket\.project
     目录           0  2018-11-12 16:32  supermarket\.settings\
     文件         364  2018-11-12 16:32  supermarket\.settings\org.eclipse.jdt.core.prefs
     文件         485  2018-11-12 16:32  supermarket\.settings\org.eclipse.wst.common.component
     文件         252  2018-11-12 16:32  supermarket\.settings\org.eclipse.wst.common.project.facet.core.xml
     目录           0  2018-11-12 16:17  supermarket\build\
     目录           0  2018-11-13 16:12  supermarket\build\classes\
     目录           0  2018-11-13 16:12  supermarket\build\classes\com\
     目录           0  2018-11-13 16:12  supermarket\build\classes\com\zyl\
     目录           0  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\
     目录           0  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\basedao\
     文件        2339  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\basedao\baseDao.class
     目录           0  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\dao\
     目录           0  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\daoimpl\
     文件        5660  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\daoimpl\BillDaoImpl.class
     文件        5362  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\daoimpl\SupplierDaoImpl.class
     文件        6965  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\daoimpl\UserDaoImpl.class
     文件         491  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\dao\BillDao.class
     文件         523  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\dao\SupplierDao.class
     文件         764  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\dao\UserDao.class
     目录           0  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\entity\
     文件        1870  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\entity\Bill.class
     文件        1497  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\entity\Supplier.class
     文件        1879  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\entity\Users.class
     目录           0  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\service\
     目录           0  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\serviceimpl\
     文件        1554  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\serviceimpl\BillServiceImpl.class
     文件        1628  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\serviceimpl\SupplierServiceImpl.class
     文件        2148  2018-11-13 16:12  supermarket\build\classes\com\zyl\www\serviceimpl\UserServiceImpl.class
............此处省略118个文件信息

评论

共有 条评论