基于JSP的人事信息管理系统的设计与实现
参考文献
[1] 《数据库系统概论》(第三版)/萨师煊 王珊编著 ,高等教育出版社. [2] 《JSP实用编程实例集锦》/马文刚、谢乐建、管知时,清华大学出版社. [3] 《JSP数据库编程指南》/布霍恩·赖特著 赵明昌译,北京希望电子出版社. [4] Herbert著.张玉清等译.Java2参考大全[M].北京:清华大学出版社.
[5] 微软公司著,高国连,李国华译.SQL Server 2000使用Transact-SQL进行数据库查询[M].北
京:北京希望电子出版社.
[6] 汪晓平等编著.精通Java网络编程[M].北京:清华大学出版社. [7] 林上杰,林康司著.JSP2.0技术手册[M].西安:电子工业出版社.
[8] 微软公司著,高国连,李国华译.SQL Server 2000使用Transact-SQL进行数据库查[M]. [9] 汪孝宜等著.JSP数据库开发实例精粹[M].北京:电子工业出版社.
[10] 微软公司著,高国连,李国华译.SQL Server 2000使用Transact-SQL进行数据库查[M]. 北京:北京希望电子出版社.
[11]邹建.《中文版SQL Server 2000开发与管理应用实例》[M].北京:人民邮电出版社,2005.
22
附录 设计实现的具体内容
数据库连接: 一DBConnect.java package hrms.database;
import java.sql.*;
import hrms.database.DBConnectionManager;
public class DBConnect {
private Connection conn = null; private Statement stmt = null;
private PreparedStatement prepstmt = null; private DBConnectionManager dcm = null; void init() { }
public DBConnect() throws Exception { }
public DBConnect(int resultSetType, int resultSetConcurrency)
dcm = DBConnectionManager.getInstance(); conn = dcm.getConnection(\
init();
stmt = conn.createStatement();
throws Exception {
init(); stmt
=
conn.createStatement(resultSetType,
resultSetConcurrency);
}
public DBConnect(String sql) throws Exception { } public
DBConnect(String
sql,
int
resultSetType,
int
init();
this.prepareStatement(sql);
resultSetConcurrency)
throws Exception {
init();
this.prepareStatement(sql,
resultSetType,
resultSetConcurrency);
}
public Connection getConnection() { }
public void prepareStatement(String sql) throws SQLException { }
public void prepareStatement(String sql, int resultSetType,
return conn;
prepstmt = conn.prepareStatement(sql);
int resultSetConcurrency) throws SQLException {
{
}
prepstmt = conn.prepareStatement(sql, resultSetType,
resultSetConcurrency);
public void setString(int index, String value) throws SQLException
}
prepstmt.setString(index, value);
public void setInt(int index, int value) throws SQLException {
}
public void setBoolean(int index, boolean value) throws SQLException {
}
public void setDate(int index, Date value) throws SQLException { }
public void setTimestamp(int index, Timestamp value) throws
prepstmt.setDate(index, value); prepstmt.setBoolean(index, value); prepstmt.setInt(index, value);
SQLException {
}
prepstmt.setTimestamp(index, value);
public void setLong(int index, long value) throws SQLException {
prepstmt.setLong(index, value);
}
public void setFloat(int index, float value) throws SQLException { }
public void setBytes(int index, byte[] value) throws SQLException { }
public void clearParameters() throws SQLException { }
public PreparedStatement getPreparedStatement() { }
public Statement getStatement() { }
public ResultSet executeQuery(String sql) throws SQLException {
if (stmt != null) {
return stmt.executeQuery(sql); return stmt; return prepstmt;
prepstmt.clearParameters(); prepstmt = null;
prepstmt.setBytes(index, value); prepstmt.setFloat(index, value);
} else
return null;
相关推荐: