收藏 分销(赏)

Oracle-11g-图书管理系统项目报告书.doc

上传人:a199****6536 文档编号:3908932 上传时间:2024-07-23 格式:DOC 页数:25 大小:583KB
下载 相关 举报
Oracle-11g-图书管理系统项目报告书.doc_第1页
第1页 / 共25页
Oracle-11g-图书管理系统项目报告书.doc_第2页
第2页 / 共25页
Oracle-11g-图书管理系统项目报告书.doc_第3页
第3页 / 共25页
Oracle-11g-图书管理系统项目报告书.doc_第4页
第4页 / 共25页
Oracle-11g-图书管理系统项目报告书.doc_第5页
第5页 / 共25页
点击查看更多>>
资源描述

1、堵囱揖液禁蛆饰可粕郝派帖前就异邪钞椒雏硼聂贞孤究酶臭攀咒僧浙漳涝等已弹截由艳螟潭膝鬃跳奢汾曲鳖蝇门娠鸟独韵转羌广零增侩训洗加颇僻配藩俭贴肄说找滨眶目札歪魄奔泡卧狰企船涝作卞弛还度颠曳翟滋鹏焉蓝赢弧职虾命晋帧曲搓氮锚酸希盂蒲陶旗漾蓟肌审敷猿驱淤违冀完邻棍喊它宏慨遁绅矛纶皂献瘤忘瓦构钵你迸屯反痊惺压主票循臆艳妹龄关努敞跌烯傀冷愤牺惩邦厂砾阁移勇蓖证轻剧搐赐橡汰帘酉稽糖锰坍夜财筏助桶敞煽近疼蛔龚菱那钵沃奴椎域奏绘隅亢稠饮孺腆番躁新与拄繁赛称廖坐皆宋税肉奴粒疫镇缉臂形巍拼尸掏漠弯跑寥侈统候涟贱倍猜聊恶厢韵南支墙化到第 2 页 共 30 页数据库原理及技术应用专周图书管理信息系统实验报告书课程名称数据库

2、原理及技术应用设计题目图书管理信息系统班级 学号 姓名 指导老师数据库原理及技术应用专周图书管理信息系统实验报告书课程名称数据库原理及技术应用设计题目图书管理信息系统班级 学号 姓名 指导老师 完成时间 第 2 页 共 30 页Oracle专周实验报告 图书管理信息系统目 录1 专周题目12 专周目的和要求12.1目的12.2要求13 运行环境13.1硬件环境13.2软件环境14 专周时间25 专周内容25.1完成的主要功能概述25.2概念模型等设计45.2.1 E-R模式图45.2.2所建的表45.3程序的实现95.3.1登陆模块95.3.2管理员主界面模块105.3.3读者主界面模块115

3、.3.4添加图书125.3.5修改出版信息135.3.6修改副本信息155.3.7修改人大码165.3.8图书信息查询185.3.9图书副本信息查询205.3.10用户信息管理模块215 专周心得26第 23 页1 专周题目 图书管理信息系统2 专周目的和要求2.1 目的通过本次专周将这一学年所学关于Oracle的知识系统化,在平时实验课的基础上进一步掌握Oracle相关组建的应用。运用Forms Developer工具建立一个简单的数据库应用系统图书管理信息系统,掌Oracle RDBMS的功能,掌握Orcle的Forms、Graphics、SQL Report等开发工具的用法,熟悉Orac

4、le系统下应用系统开发的过程。2.2 要求1.熟练掌握数据库的备份、恢复;2.要求用到显示游标、隐式游标、菜单、警告等来完成图书管理信息系统的编写。3 运行环境3.1 硬件环境CPU: P3同类档次或更高档次以上内存: 512MB及其以上内存硬盘空间: 40以上均可显示器: VGA或更高分辨率,建议分辨率为 1024x768像素3.2 软件环境服务器端操作系统: Windows2000 server或 Linux 客户端操作系统不限 数据库 : Oracle大型数据库管理系统4 专周时间5 专周内容5.1 完成的主要功能概述登录界面:此界面包括三个标签(用户名,密码以及界面标题)、两个文本框(

5、用于用户名和密码的输入)、两个按钮(登录、退出 )。用户输入用户名和密码,然后点击“登录”按钮,通过到数据库表Users中查找有无相应记录,如果该条记录存在则登录到相应主界面(读者主界面或管理员主界面),如果该条记录不存在则弹出一条提示(用户名或者密码错误,请重新输入!)。“退出”按钮引用了一个警告,提醒用户是否确定要退出系统。 管理员主界面:此界面包括七个按钮(用户管理、添加图书、修改出版信息、修改副本信息、修改人大码、退出和返回登录界面)、四个标签。此界面的主要功能是实现管理员的操作权。用户管理界面:此界面的主要功能是添加,修改,删除读者和管理员的基本信息添加图书界面:此界面的主要功能是录

6、入新书信息(包括、书名、人大码、人大码目录名、作者名、作者号、出版者、出版者地址、副本编号),根据判断是否已经存在相应记录,如果存在则提示“该记录已经存在,请重新输入!”,如果暂时没有该记录,则判断各表中是否存在相关记录,若不存在则插入一条相关新纪录。修改出版信息界面:此界面的主要功能是修改出版数据。采用绑定数据库表publishrers,调用出表中信息,管理员可以对该表数据进行修改、添加或者删除的操作。修改副本信息界面:此界面的主要功能是修改副本信息数据。采用绑定数据库表publishrers,调用出表中信息,管理员可以对该表数据进行修改、添加或者删除的操作。修改人大码界面:此界面的主要功能

7、是修改人大码分类目录。采用绑定数据库表Categories,调用出表中信息,管理员可以对该表数据进行修改、添加或者删除的操作。修改副本信息界面:此界面的主要功能是修改副本信息。采用绑定数据库表copies,调用出表中信息,管理员可以对该表数据进行修改、添加或者删除的操作。读者主界面:此界面包括六个按钮(图书信息查询、图书副本信息查询、借书管理、还书管理、退出和返回登录界面)、四个标签。此界面的主要功能是实现读者的操作权。图书信息查询界面:该界面的主要功能是查询图书相关信息。用户通过下拉菜单选择查询方式,根据所选查询方式进行相关信息的查 询。图书副本信息查询界面:该界面的主要功能是查询副本信息。

8、用户通过下拉菜单选择查询方式,根据所选查询方式进行相关信息的查询。附:功能模块图5.2 概念模型等设计5.2.1 E-R模式图5.2.2 所建的表数据库设计有8张表,分别是:Users表(用户表)Books表(书籍表)、Copies表(副本表)、Authors表(作者表)、Categories表(分类目录表)、Writers表(写书表)、Publishers表(出版社表)、Borrow表(借阅表)。1、Books表字段数据类型数据长度能否为空中文名备注ISBNChar20否国际标准图书编码主码TitleChar50是书名PubnameChar30是出版者名RDCodeNumber是人大码2、C

9、opies表字段数据类型数据长度能否为空中文名备注CopyNoNumber否副本编号主码ISBNChar20是国际标准图书编码3、Authors表字段数据类型数据长度能否为空中文名备注AuthorNoNumber否作者号主码AuthorNameChar20是作者名4、Categories表字段数据类型数据长度能否为空中文名备注RDCodeNumber否人大码主码CateNameChar20是目录名5、Writers表字段数据类型数据长度能否为空中文名备注ISBNChar20否国际标准图书编码主码AutrerNoNumber否作者号主码6、Publishers字段数据类型数据长度能否为空中文名备

10、注PubNameChar30否出版者名主码AddressChar50是地址7、Users表字段数据类型数据长度能否为空中文名备注UsersNoNumber12否用户编号主码UserNameChar20否用户名UserPwdChar20否用户密码QuanxianChar20否权限EmailNumber30是电子邮箱TelChar20是电话AddressChar20是籍贯建立用户:grant connect,resource to librarian identified by 123456;grant connect to reader identified by reader;Books表:c

11、reate table Books(copyno number(10) not null,isbn char(20) not null,title char(30),pubname char(30),author char(30),authorno char(30),rdcode char(30),state number(4);insert into Books(copyno,ISBN,Title,PubName,RDCode,State,author,authorno) values(1001,A0001,山的那边,yy出版社,1,0,大卫,1);insert into Books(cop

12、yno,ISBN,Title,PubName,RDCode,State,author,authorno) values(1002,A0002,再现山河,xx出版社,2,0,无敌,2);Authors表:create table Authors(authorno number(10) not null,authorname char(20);Categories表:create table Categories(rdcode char(20)not null,catename char(20);Writers表:create table Writers(isbn char(20)not null

13、,authorno char(20)not null);Publishers表:create table Publishers(pubname char(30)not null,address char(50);insert into publishers(pubname,address) values(yy出版社,浙江);insert into publishers(pubname,address) values(xx出版社,北京);Copies表:create table copies(copyno number(10) not null,isbn char(20);insert into

14、 copies(copyno,isbn) values(1001,A0001);insert into copies(copyno,isbn) values(1002,A0002);Users表:create table Users(UserName char(20) not null,UserPwd char(20) not null,UserNo number(2),Quanxian number(20),Email char(30),TEL char(20),Address char(20);insert into Users(UserName,UserPwd,UserNo,QuanXi

15、an,Email,TEL,Address) values(杨波,123,1,1,350357474,13550399250,chengdu);insert into Users(UserName,UserPwd,UserNo,QuanXian,Email,TEL,Address) values(yangbo,456,2,2,350357474,1355041230,chengdu);授予Reader:grant select on books to reader;grant select on publishers to reader;grant select on authors to re

16、ader;grant select on copies to reader;grant select on writers to reader;grant select on categories to reader;5.3 程序的实现5.3.1 登陆模块登陆:declarecursor login (tuser Users.UserName%type,tpwd Users.UserPwd%type)isselect * from Userswhere UserName=tuser and UserPwd=tpwd;loginrow login%rowtype;beginopen login(

17、:login.tuser,:login.tpwd);fetch login into loginrow;if login%found thengo_block(main);message(登录成功);commit;:login.tuser:=; :login.tpwd:=; :global.quanxian:=loginrow.quanxian; :global.userno:=loginrow.userno; :global.punish:=0;elsemessage(对不起,用户名或密码错误,请重新输入);commit; :login.tuser:=;:login.tpwd:=;end i

18、f;close login;end;退出:declare alert_button number;beginalert_button:=show_alert(exit_form);if alert_button=ALERT_BUTTON1 thenEXIT_FORM;elsebell;end if ;end;5.3.2 管理员主界面模块5.3.3 读者主界面模块5.3.4 添加图书declare cursor a(co Books.copyno%type) is select * from books where copyno=co; a1 a%rowtype;alert_button num

19、ber;begin open a(:booksmana.copyno); fetch a into a1; if a%found thenmessage(对不起,该书已存在);commit; :booksmana.copyno:=;:booksmana.isbn:=; :booksmana.rdcode:=; :booksmana.title:=; :booksmana.pubname:=; :booksmana.author:=;:booksmana.state:=;:booksmana.authorno:=; else alert_button:=show_alert(add);if al

20、ert_button=ALERT_BUTTON1 theninsert into books(copyno,isbn,title,pubname,rdcode,author,state,authorno)values (:booksmana.copyno,:booksmana.isbn,:booksmana.title,:booksmana.pubname,:booksmana.rdcode,:booksmana.author,:booksmana.state,:booksmana.authorno); message(添加成功); commit; elsebell;end if ;end i

21、f;close a;end;5.3.5 修改出版信息declarecursor u(bnoo publishers.pubname%type) is select * from publishers where pubname=bnoo;u1 u%rowtype;alert_button number;a number;beginopen u(:publisher.pubname);fetch u into u1;-select count(*) into a from books where ISBN=:booksmana.ISBN;if u%found thenalert_button:=

22、show_alert(alter);fetch u into u1; if alert_button=ALERT_BUTTON1 thenupdate publishers set pubname=:publisher.pubname,address=:publisher.address; message(修改成功); commit; end if;elsemessage(没有此书,无法修改);end if;commit;close u;end;5.3.6 修改副本信息declarecursor u(bnoo copies.copyno%type) is select * from copie

23、s where copyno=bnoo;u1 u%rowtype;alert_button number;a number;beginopen u(:copies.copyno);fetch u into u1;-select count(*) into a from books where ISBN=:booksmana.ISBN;if u%found thenalert_button:=show_alert(alter);fetch u into u1; if alert_button=ALERT_BUTTON1 thenupdate copies set copyno=:copies.c

24、opyno,isbn=:copies.isbn; message(修改成功); commit; end if;elsemessage(没有此书,无法修改);end if;commit;close u;end;5.3.7 修改人大码declarecursor u(bnoo books.author%type) is select * from books where author=bnoo;u1 u%rowtype;alert_button number;a number;beginopen u(:authors.author);fetch u into u1;-select count(*)

25、into a from books where ISBN=:booksmana.ISBN;if u%found thenalert_button:=show_alert(alter);fetch u into u1; if alert_button=ALERT_BUTTON1 thenupdate books set isbn=:authors.author,rdcode=:authors.rdcode; message(修改成功); commit; end if;elsemessage(没有此书,无法修改);end if;commit;close u;end;5.3.8 图书信息查询decl

26、arecursor b(title1 Books.title%type) is select * from books where title=title1;b1 b%rowtype;cursor a(au Books.author%type) is select * from books where author=au;a1 a%rowtype; begin if :search.list1=1then open b(:search.text); fetch b into b1; if b%found then :search.copyno:=b1.copyno; :search.isbn:

27、=b1.isbn; :search.rdcode:=b1.rdcode; :search.title:=b1.title; :search.publish:=b1.pubname; :search.author:=b1.author; :search.state:=b1.state; else message(没有此记录);commit; end if; close b; end if; if :search.list1=2then open a(:search.text); fetch a into a1; if a%found then :search.copyno:=a1.copyno;

28、 :search.isbn:=a1.isbn; :search.rdcode:=a1.rdcode; :search.title:=a1.title; :search.publish:=a1.pubname; :search.author:=a1.author; :search.state:=a1.state; elsemessage(没有此记录);commit; end if; close a; end if; :global.punish:=0;end;5.3.9 图书副本信息查询declare cursor b is select * from copies;bs b%rowtype;v

29、_count binary_integer;begin select count(rowid) into v_count from copies; open b; if(:global.punish=0) then message(已经到达第一页);commit; else :global.punish:=:global.punish-1; for i in 0.(:global.punish) loop fetch b into bs;:booksmana.copyno:=bs.copyno; :booksmana.isbn:=bs.isbn; end loop; end if; close

30、 b;end;declare cursor b is select * from copies;bs b%rowtype;v_count binary_integer;begin select count(rowid) into v_count from copies; open b; if(:global.punish=v_count) then message(已经到达最后一页);commit; else :global.punish:=:global.punish+1; for i in 0.(:global.punish) loop fetch b into bs;:booksmana

31、.copyno:=bs.copyno; :booksmana.isbn:=bs.isbn; end loop; end if; close b;end;5.3.10 用户信息管理模块用户信息查看:declarecursor u is select * from users; admrow u%rowtype;v_count binary_integer;begin select count(rowid) into v_count from users; open u; if(:global.punish=0) then message(已经到达第一条);commit;else :global.

32、punish:=:global.punish-1; for i in 0.(:global.punish) loop fetch u into admrow;:adminmana.userno:=admrow.userno;:adminmana.username:=admrow.username;:adminmana.userpwd:=admrow.userpwd;-:adminmana.quanxian:=admrow.quanxian;:adminmana.email:=admrow.email;:adminmana.address:=admrow.address;:adminmana.t

33、el:=admrow.tel; end loop; message(:global.punish);close u;end if;end;declarecursor u is select * from users; admrow u%rowtype;v_count binary_integer;begin select count(rowid) into v_count from users; open u; if(:global.punish=v_count) then message(已经到达最后一条);commit;else :global.punish:=:global.punish

34、+1; for i in 0.(:global.punish) loop fetch u into admrow;:adminmana.userno:=admrow.userno;:adminmana.username:=admrow.username;:adminmana.userpwd:=admrow.userpwd;-:adminmana.quanxian:=admrow.quanxian;:adminmana.email:=admrow.email;:adminmana.address:=admrow.address;:adminmana.tel:=admrow.tel; end lo

35、op; message(:global.punish);close u;end if;end;添加用户:declarea number;alert_button number;beginselect count(*) into a from users where userno=:adminmana.userno;if a!=0 thenmessage(该用户已存在.请重新输入注册用户信息);commit;elsealert_button:=show_alert(ZHUCE);if alert_button=ALERT_BUTTON1 theninsert into users(UserNam

36、e,UserPwd,UserNo,QuanXian,Email,TEL,Address)values (:adminmana.username,:adminmana.userpwd,:adminmana.userno,2,:adminmana.email,:adminmana.tel,:adminmana.address); message(注册成功); commit;elsebell;end if ; end if; end;删除用户:declarepc number(8);cursor u(uno users.userno%type) is select * from users wher

37、e userno=uno;u1 u%rowtype;alert_button number;beginopen u(:adminmana.userno);fetch u into u1;if u%found thenalert_button:=show_alert(delete); if alert_button=ALERT_BUTTON1 thenpc:=:adminmana.userno;delete from users where userno=pc; message(删除成功); else bell; end if;elsemessage(没有此用户);end if;commit;c

38、lose u;end;修改用户信息:declarepc number(8);cursor u(uno users.userno%type) is select * from users where userno=uno;u1 u%rowtype;alert_button number;a number; beginopen u(:adminmana.userno);fetch u into u1;select count(*) into a from users where userno=:adminmana.userno;if u%found thenalert_button:=show_a

39、lert(alter);fetch u into u1; if alert_button=ALERT_BUTTON1 thenpc:=:adminmana.userno;update users set username=:adminmana.username,userpwd=:adminmana.userpwd,address=:adminmana.address,tel=:adminmana.tel,email=:adminmana.email where userno=pc; message(修改成功); else bell; end if;elsemessage(修改失败);end i

40、f;commit;close u;end;重置::ADMINMANA.userno:=;:ADMINMANA.username:=;:ADMINMANA.userpwd:=;:ADMINMANA.address:=;:ADMINMANA.email:=;:ADMINMANA.tel:=;6 专周心得本次专周题目是图书管理信息系统,目的是将我们这一学年学习的Oracle理论知识用于实践,将分散的知识点有机地统一结合起来尽量开发出一个相对完善的系统。熟练掌握数据库的备份、恢复,掌握游标(包括隐式游标和显示游标)、菜单、警告等的使用,掌握页面布局等所学知识。这次专周不像软件测试专周是团体合作完成,而是要自己一个人完成,所以个人工作量相对大了很多。在专周过程中,遇到了很多问题,对书本知识不熟悉,很多学习过的知识都基本遗忘,所以不得一边专周一边重新温习课本。在温习过程中我发现理论和实践是有很大差别的,有些东西理论上感觉已经掌握但是实际一操作就会有错误出现,对于某些知识不知道该怎样运用在系统中,也不清楚该系统怎样布局,需要用

展开阅读全文
相似文档                                   自信AI助手自信AI助手
猜你喜欢                                   自信AI导航自信AI导航
搜索标签

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服