资源简介
内含配置说明书
本系统采用Microsoft SQLServer2000作为数据库服务器
要运行本系统,还需要一个JSP容器或者java应用服务器,这里以Weblogic8.1为例介绍如何配置。

代码片段和文件信息
package com.csbook.documentsystem;
import javax.naming.*;
import javax.sql.*;
import java.sql.*;
import java.util.*;
/**
* title:
* Description:
* Copyright: Copyright (c) 2003
* Company:
* @author not attributable
* @version 1.0
*/
public class BorrowMan{
Context ctx = null;
DataSource ds = null;
SysLog log = null;
ChangeEncoding ce=null;
//构造函数
public BorrowMan() {
//从连接池中获取数据库连接
try {
ctx = new InitialContext();
ds = (DataSource)ctx.lookup(“documents“);
}
catch (NamingException e) {
e.printStackTrace();
}
log = new SysLog();
ce=new ChangeEncoding();
}
//借阅档案
public void borrowDocument(int doc String borrower
String begintime String endtime String reason) {
Connection con = null;
PreparedStatement ps = null;
DocMan dMan=new DocMan();
String docName=dMan.getDocNameById(doc);
if (this.getBorrowStateById(doc) == 1){
log.addMsg(“system“ borrower “您所申请借阅的“ + docName + “已被别人借阅,请稍候时日“ 1);
}
else {
try {
String strInsert = “insert into borrowRecord(documentborrowerbegintimeendtimereasonstate) values(??????)“;
con = ds.getConnection();
ps = con.prepareStatement(strInsert);
ps.setInt(1 doc);
ps.setString(2 borrower);
ps.setString(3 begintime);
ps.setString(4 endtime);
ps.setString(5ce.changeCharset(reason));
ps.setInt(6 0);
ps.executeUpdate();
log.addMsg(“system“ borrower “您借阅“ + docName + “的申请已经提交,等待批准“ 1);
}
catch (SQLException e) {
e.printStackTrace();
}
finally {
if (ps != null) try {ps.close();}
catch (SQLException ignore) {}
if (con != null)try{ con.close();}
catch (SQLException ignore) {}
}
}
}
//根据档案编号获取该档案的借阅信息
public Hashtable getBorrowInfo(int borrowId) {
Connection con = null;
PreparedStatement ps = null;
ResultSet rs = null;
Hashtable borrows = new Hashtable();
try {
String strQuery = “select * from borrowRecord where id=?“;
con = ds.getConnection();
ps = con.prepareStatement(strQuery);
ps.setInt(1 borrowId);
rs = ps.executeQuery();
String temp;
Integer temp1;
if (rs.next()) {
borrows.put(“document“(new Integer(rs.getInt(“document“)).toString()));
borrows.put(“borrower“ rs.getString(“borrower“));
borrows.put(“begintime“ rs.getString(“begintime“));
borrows.put(“endtime“ rs.getString(“endtime“));
temp1=new Integer(rs.getInt(“state“));
borrows.put(“state“ temp1.toString());
temp=rs.getString(“lender“);
if(temp==null||temp.equals(““))
borrows.put(“lender““ “);
else
borrows.put(“lender“temp);
borrows.put(“reason“c
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 309248 2004-04-15 16:56 ch05\档案管理系统配置说明.doc
文件 10215 2004-03-20 18:21 ch05\源代码\DocumentSystem\defaultroot\action.jsp
文件 2622 2003-12-06 17:15 ch05\源代码\DocumentSystem\defaultroot\addDocument.jsp
文件 2120 2003-12-06 16:58 ch05\源代码\DocumentSystem\defaultroot\addlibinfo.jsp
文件 1690 2004-03-20 18:03 ch05\源代码\DocumentSystem\defaultroot\changeDept.jsp
文件 757 2003-12-06 16:58 ch05\源代码\DocumentSystem\defaultroot\default.htm
文件 1423 2004-03-20 18:32 ch05\源代码\DocumentSystem\defaultroot\deptMan.jsp
文件 2624 2003-12-08 14:42 ch05\源代码\DocumentSystem\defaultroot\docba
文件 4004 2003-12-06 16:58 ch05\源代码\DocumentSystem\defaultroot\docinfo.jsp
文件 3207 2004-03-19 16:33 ch05\源代码\DocumentSystem\defaultroot\doclist.jsp
文件 2577 2003-12-06 16:58 ch05\源代码\DocumentSystem\defaultroot\docsearch.jsp
文件 1779 2003-12-06 16:58 ch05\源代码\DocumentSystem\defaultroot\docSearchResult.jsp
文件 198 2004-03-19 10:07 ch05\源代码\DocumentSystem\defaultroot\err.jsp
文件 704 2004-03-19 10:03 ch05\源代码\DocumentSystem\defaultroot\index.jsp
文件 2808 2003-12-29 19:49 ch05\源代码\DocumentSystem\defaultroot\libinfo.jsp
文件 3179 2004-03-19 16:54 ch05\源代码\DocumentSystem\defaultroot\liblist.jsp
文件 693 2004-03-19 10:16 ch05\源代码\DocumentSystem\defaultroot\login.jsp
文件 256 2003-12-06 16:58 ch05\源代码\DocumentSystem\defaultroot\logout.jsp
文件 1006 2003-12-06 16:58 ch05\源代码\DocumentSystem\defaultroot\menu.jsp
文件 1341 2003-12-06 16:58 ch05\源代码\DocumentSystem\defaultroot\myRecord.jsp
文件 428 2004-03-19 17:11 ch05\源代码\DocumentSystem\defaultroot\right.jsp
文件 384 2003-12-01 13:16 ch05\源代码\DocumentSystem\defaultroot\tools.js
文件 491 2004-03-19 09:29 ch05\源代码\DocumentSystem\defaultroot\top.jsp
文件 2590 2004-03-19 17:19 ch05\源代码\DocumentSystem\defaultroot\userMan.jsp
文件 179 2004-03-20 18:34 ch05\源代码\DocumentSystem\defaultroot\WEB-INF\web.xm
文件 179 2003-12-04 20:44 ch05\源代码\DocumentSystem\defaultroot\WEB-INF\web.xm
文件 179 2003-12-29 11:44 ch05\源代码\DocumentSystem\defaultroot\WEB-INF\web.xm
文件 179 2003-12-29 12:06 ch05\源代码\DocumentSystem\defaultroot\WEB-INF\web.xm
文件 210 2004-03-20 18:34 ch05\源代码\DocumentSystem\defaultroot\WEB-INF\weblogic.xm
文件 464 2003-12-04 20:44 ch05\源代码\DocumentSystem\defaultroot\WEB-INF\weblogic.xm
............此处省略47个文件信息
- 上一篇:jsp动态论坛+后台+界面+模版
- 下一篇:将一段文字转化为哈夫曼编码JAVA实现
相关资源
- 微博系统(Java源码,servlet+jsp),适
- java串口通信全套完整代码-导入eclip
- jsonarray所必需的6个jar包.rar
- 三角网构TIN生成算法,Java语言实现
- java代码编写将excel数据导入到mysql数据
- Java写的cmm词法分析器源代码及javacc学
- JAVA JSP公司财务管理系统 源代码 论文
- JSP+MYSQL旅行社管理信息系统
- 推荐算法的JAVA实现
- 基于Java的酒店管理系统源码(毕业设
- java-图片识别 图片比较
- android毕业设计
- java23种设计模式+23个实例demo
- java Socket发送/接受报文
- JAVA828436
- java界面美化 提供多套皮肤直接使用
- 在线聊天系统(java代码)
- 基于Java的图书管理系统807185
- java中实现将页面数据导入Excel中
- java 企业销售管理系统
- java做的聊天系统(包括正规课程设计
- Java编写的qq聊天室
- 商店商品管理系统 JAVA写的 有界面
- JAVA开发聊天室程序
- 在linux系统下用java执行系统命令实例
- java期末考试试题两套(答案) 选择(
- JAVA3D编程示例(建模、交互)
- Java 文件加密传输
- java做的房产管理系统
- 基于jsp的bbs论坛 非常详细
评论
共有 条评论