资源简介

库存商品管理(jsp)——试题讲解源码及资料,本试题使用Jsp+Servlet+Mysql+JDBC等技术实现库存商品管理,资料齐全

资源截图

代码片段和文件信息

package com.yy.dao;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Properties;
//重构
public class JDBCUitls {
private static String driverClassName;
private static String url;
private static String username;
private static String password;

static {
try {
Properties props = new Properties();
InputStream in =  JDBCUitls.class.getResourceAsStream(“/db.properties“); 
props.load(in);

driverClassName = props.getProperty(“driverClassName“);
url = props.getProperty(“url“);
username = props.getProperty(“username“);

password = props.getProperty(“password“);

Class.forName(driverClassName);
} catch (ClassNotFoundException  | IOException e) {
e.printStackTrace();
}
}
//得到连接对象
public static Connection getConnection() throws SQLException {
Connection conn = DriverManager.getConnection(urlusernamepassword);

return conn;
}
//关闭连接对象
public static void closeConnection(Connection conn) throws SQLException {
if(conn != null) {
conn.close();
}
}

public static int executeUpdate(String sqlobject... params) throws SQLException {
Connection conn = getConnection();
PreparedStatement ps = conn.prepareStatement(sql);
if(params != null) {
//给占位符赋值
for(int i = 0;i < params.length;i++) {
ps.setobject(i+1 params[i]);
}
}

int n = ps.executeUpdate();

conn.close();

return n;
}

public static ResultSet executeQuery(Connection connString sqlobject... params) throws SQLException {

PreparedStatement ps = conn.prepareStatement(sql);
if(params != null) {
//给占位符赋值
for(int i = 0;i < params.length;i++) {
ps.setobject(i+1 params[i]);
}
}

ResultSet rs = ps.executeQuery();

return rs;
}
}













 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        842  2018-01-06 06:28  ware_project\.classpath

     文件        912  2018-01-06 06:28  ware_project\.project

     文件        567  2018-01-06 06:28  ware_project\.settings\.jsdtscope

     文件        364  2018-01-06 06:28  ware_project\.settings\org.eclipse.jdt.core.prefs

     文件        488  2018-01-06 06:28  ware_project\.settings\org.eclipse.wst.common.component

     文件        345  2018-01-06 06:28  ware_project\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2018-01-06 06:28  ware_project\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2018-01-06 06:28  ware_project\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       2628  2018-01-06 06:30  ware_project\build\classes\com\yy\dao\JDBCUitls.class

     文件        321  2018-01-06 07:24  ware_project\build\classes\com\yy\dao\WareTableDao.class

     文件       2173  2018-01-06 07:24  ware_project\build\classes\com\yy\dao\WareTableDaoImpl.class

     文件       1195  2018-01-06 06:34  ware_project\build\classes\com\yy\entity\WareTable.class

     文件        333  2018-01-06 07:24  ware_project\build\classes\com\yy\service\WareTableService.class

     文件       1015  2018-01-06 07:25  ware_project\build\classes\com\yy\service\WareTableServiceImpl.class

     文件       3193  2018-01-06 07:53  ware_project\build\classes\com\yy\servlet\WareTableServlet.class

     文件        107  2018-01-03 15:29  ware_project\build\classes\db.properties

     文件       2119  2018-01-04 09:15  ware_project\src\com\yy\dao\JDBCUitls.java

     文件        315  2018-01-06 07:24  ware_project\src\com\yy\dao\WareTableDao.java

     文件       1376  2018-01-06 07:24  ware_project\src\com\yy\dao\WareTableDaoImpl.java

     文件        823  2018-01-06 06:34  ware_project\src\com\yy\entity\WareTable.java

     文件        323  2018-01-06 07:24  ware_project\src\com\yy\service\WareTableService.java

     文件        649  2018-01-06 07:25  ware_project\src\com\yy\service\WareTableServiceImpl.java

     文件       2830  2018-01-06 07:53  ware_project\src\com\yy\servlet\WareTableServlet.java

     文件        107  2018-01-03 15:29  ware_project\src\db.properties

     文件         39  2018-01-06 06:28  ware_project\WebContent\meta-INF\MANIFEST.MF

     文件     414240  2018-01-03 15:18  ware_project\WebContent\WEB-INF\lib\jstl-1.2.jar

     文件     989497  2017-12-18 09:46  ware_project\WebContent\WEB-INF\lib\mysql-connector-java-5.1.39-bin.jar

     文件       1314  2018-01-06 07:18  ware_project\WebContent\WEB-INF\waretable\add.jsp

     文件        452  2018-01-06 07:43  ware_project\WebContent\WEB-INF\waretable\error.jsp

     文件        598  2018-01-06 07:42  ware_project\WebContent\WEB-INF\waretable\result.jsp

............此处省略28个文件信息

评论

共有 条评论