最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx

上传人:b****1 文档编号:4212777 上传时间:2023-05-03 格式:DOCX 页数:15 大小:170.09KB
下载 相关 举报
最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx_第1页
第1页 / 共15页
最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx_第2页
第2页 / 共15页
最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx_第3页
第3页 / 共15页
最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx_第4页
第4页 / 共15页
最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx_第5页
第5页 / 共15页
最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx_第6页
第6页 / 共15页
最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx_第7页
第7页 / 共15页
最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx_第8页
第8页 / 共15页
最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx_第9页
第9页 / 共15页
最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx_第10页
第10页 / 共15页
最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx_第11页
第11页 / 共15页
最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx_第12页
第12页 / 共15页
最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx_第13页
第13页 / 共15页
最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx_第14页
第14页 / 共15页
最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx_第15页
第15页 / 共15页
亲,该文档总共15页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx

《最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx(15页珍藏版)》请在冰点文库上搜索。

最新版数据库毕业课程设计报告汽车租赁管理系统Word格式文档下载.docx

3.逻辑设计

建表语句如下:

用户表:

后为各字段意义声明

createtableuserinfo

pidvarchar(8)primarykey,用户证件号

usernamevarchar(8),用户名

isvipint,用户类型,是否为会员

xingyuint,信誉度,满分100。

passwordvarchar(8)用户登录密码

);

管理员表:

createtablemanager

widvarchar(8)primarykey,管理员工号

typeint,类型,超级管理员(部门经理等)和普通管理员

usernamevarchar(8),管理员用户名

passwordvarchar(8)管理员密码

车辆表:

createtabletaxi

tidvarchar(8)primarykey,车辆编号

typevarchar(8),车辆类型

statevarchar(8),车辆状态,是否可租

widvarchar(8),

yearint,起租年月日

monthint,

dayint,

timeint,

detailinfotext,车辆详细信息

payint租用单价

租车信息表

createtablerentinfo

ridintidentity(1,1)primarykey,交易编号

widvarchar(8),经手人员

pidvarchar(8),客户证件号

tidvarchar(8),车辆号码

yajinint,押金

backmoneyint,返还金额

payint,单价

brokenvarchar(8),破坏情况

outyearint,结束交易时间

outmonthint,

outdayint,

timeint,实际使用时间

statevarchar(8)交易状态

);

--设置外键

BEGINTRANSACTION

altertabledbo.rentinfoaddconstraintFK_rentinfo_tid

foreignkey(tid)

referencesdbo.taxi([tid])

altertabledbo.rentinfoaddconstraintFK_rentinfo_pid

foreignkey(pid)

referencesdbo.userinfo([pid])

altertabledbo.rentinfoaddconstraintFK_rentinfo_wid

foreignkey(wid)

referencesdbo.manager([wid])

COMMITTRANSACTION

4.数据库建立与备份,恢复

在sqlserver2005建立一个数据库,名称为hello,执行以上建表语句即可。

或者将hello.mdf,.setAttribute("

type"

"

1"

session.setAttribute("

pid"

pid);

username"

username);

response.sendRedirect("

user.jsp"

转向客户页面

}

}else{转向管理员页面,以下与上面if语句类似。

Stringsql="

select*frommanagerwhereusername='

"

+username+"

'

+"

andpassword='

+password

+"

andtype="

+type;

System.out.println(sql);

rs=dm.getResult(sql);

if(rs.next()){

Stringwid=rs.getString("

wid"

t);

wid);

manager.jsp"

}

此外,系统具有良好的安全性,对每个页面都有良好的保护措施,如manashare.jsp,usershar.jsp,通过session验证用户有无权限进入该页面,否则跳转到login.jsp页面,重新登录。

三.程序设计

1.含有表单的jsp页面可以通过设置隐藏域的值来提交到本页面,其程序流程如下:

2.财务管理中有个导出execl报表的功能,其实现如下:

从网上下载一个jxl.jar包,该jar包支持生成execl文件的操作,然后建立一个专门的类,用于生成execl,该类源码如下:

packagemy.pkgs;

importjava.io.*;

importjxl.*;

jxl.jar里面的类库

importjxl.write.*;

importjava.sql.*;

publicclassCreateXLS{

publicStringcreate(ResultSetrs,Stringfilename)

{

try{

Filef=newFile(filename);

booleanexist=f.exists();

WritableWorkbookbook=Workbook.createWorkbook(newFile(filename));

生成名为“第一页”的工作表,参数0表示这是第一页

WritableSheetsheet=book.createSheet("

第一页"

0);

在Label对象的构造子中指名单元格位置是第一列第一行(0,0)

以及单元格内容为test

Labellabel0=newLabel(0,0,"

交易号"

Labellabel1=newLabel(1,0,"

经手人员"

Labellabel2=newLabel(2,0,"

客户证号"

Labellabel3=newLabel(3,0,"

车辆号码"

Labellabel4=newLabel(4,0,"

押金(元)"

Labellabel5=newLabel(5,0,"

返还金额(元)"

Labellabel6=newLabel(6,0,"

破坏情况"

Labellabel7=newLabel(7,0,"

开始时间"

Labellabel8=newLabel(8,0,"

实收金额(元)"

sheet.addCell(label0);

sheet.addCell(label1);

sheet.addCell(label2);

sheet.addCell(label3);

sheet.addCell(label4);

sheet.addCell(label5);

sheet.addCell(label6);

sheet.addCell(label7);

sheet.addCell(label8);

inti=1;

while(rs.next()){

jxl.write.Numberlabel01=newjxl.write.Number(0,i,rs.getInt

(1));

Labellabel11=newLabel(1,i,rs.getString

(2));

Labellabel21=newLabel(2,i,rs.getString(3));

Labellabel31=newLabel(3,i,rs.getString(4));

jxl.write.Numberlabel41=newjxl.write.Number(4,i,rs.getInt(5));

jxl.write.Numberlabel51=newjxl.write.Number(5,i,rs.getInt(6));

Labellabel61=newLabel(6,i,rs.getString(8));

Labellabel71=newLabel(7,i,rs.getInt(9)+"

-"

+rs.getInt(10)+"

+rs.getInt(11));

jxl.write.Numberlabel81=newjxl.write.Number(8,i,rs.getInt(5)

-rs.getInt(6));

sheet.addCell(label01);

sheet.addCell(label11);

sheet.addCell(label21);

sheet.addCell(label31);

sheet.addCell(label41);

sheet.addCell(label51);

sheet.addCell(label61);

sheet.addCell(label71);

sheet.addCell(label81);

i++;

}

book.write();

book.close();

}catch(Exceptione){

e.printStackTrace();

return"

ok"

;

测试creat方法

publicstaticvoidmain(String[]arg)throwsSQLException

CreateXLSc=newCreateXLS();

DataManagerdm=newDataManager();

select*fromrentinfowhereoutyear="

+2009

andstate='

交易完成'

System.out.println(sql);

ResultSetrs=dm.getResult(sql);

c.create(rs,"

c:

\\3.xls"

}

在jsp页面中调用该类方法既能生成Exel文件,源码如下:

该文件名按apachetomcat安装目录而定

Stringfilename="

C:

ProgramFilesApacheSoftwareFoundationTomcat5.5webappsCOURSEPROJECTexecls"

+year+"

+month+"

.xls"

CreateXLScxls=newCreateXLS();

cxls.create(rss,filename);

3.用到了数据库知识里面的触发器,该触发器用于新增交易信息时,sql语句如下:

SETANSI_NULLSON

GO

SETQUOTED_IDENTIFIERON

CREATETRIGGERrent1

onrentinfo

AFTERinsert

AS

BEGIN

updatetaxi

settaxi.state=i.state,

taxi.year=i.outyear,

taxi.month=i.outmonth,

taxi.day=i.outday,

    taxi.time=i.time

fromtaxit,Insertedi

wheret.tid=i.tid

SETNOCOUNTON;

END

查询用户李明的租车记录

Selectt.type,t.state,t.year,t.month,t.day,t.time,t.pay

Fromtaxi0303tjoinrentinfo0303ronr.wid=t.wid

Joinuserinfo0303uonr.pid=u.pid

Whereu.name=’王充’

四.总结

本次实验的最大收获就是真正写了个关于数据库的软件。

数据库无论在现在各类软件中都有涉及,所以数据库对于计算机从业者来说是一门必须掌握的课程。

本次试验只能说是初步了解了数据库编程的一些知识,许多高深的数据库知识如sql优化都未能研究深入。

其次是对jsp编程有了一定得了解。

因为是首次学习jsp编程,没有用到javabean,更不用说struts,hibernate,spring框架,所用到的技术非常简单,属于“菜鸟级“,不过,打下了web编程的基础,相信以后会对web开发更有兴趣。

最后,对软件工程的知识有了一定了解。

本次试验成果可以说是一个软件(质量暂且不论),软件的完成需要固定的几个步骤:

需求分析,概念设计,编码,测试等等,经过本次尝试,终于知道了需求分析的重要性,它是整个软件的基础,影响到软件的功能是否完善等等,所以需求分析一定要到位。

还有测试,测试用例一定要全面,否则,功能实现就会有缺陷。

以上就是本次实验的心得体会。

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 自然科学 > 物理

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2