1、Java 图书馆管理系统附全代码 课程设计报告数据库系统概论课程报告课题名称: 小型图书管理系统 课题负责人名(学号): et 同组成员名单(角色): 指导教师: 评阅成绩: 评阅意见: 提交报告时间:01年12月15日小型图书管理系统 计算机科学与技术 专业学生 指导老师 摘要 随着计算机技术的飞速发展,利用计算机来获得和处理信息是当今信息管理的一大特点、伴随计算机硬件的快速发展,有关信息管理的软件-数据库系统软件也在迅猛发展着。图书馆是高等院校的重要组成部门,是教师和学生获取知识的重要场所。由于图书馆主要从事大量的图书资料的储存和流通。因此一直以来,计算机在图书馆的图书管理中得到了广泛的应
2、用。本系统实现图书信息管理的系统化,规范化和自动化,以最大程度提高操作人员的办公效率。关键词:JAVA、JDBC、SQLevr、数据库、图书馆管理一、实验题目:小型图书管理系统二、实验的目的和要求:完成一个小型图书管理系统,功能要求如下:1)能够通过书籍基本信息(包括:书号、书名、出版社、出版日期、作者、内容摘要)单个或以ND方式组合多个条件查询书籍信息;2)关于每一种书籍,除可查看其基本信息之外还可查看其总数以及目前在馆数量3)可增添新的书籍4)可删除已有书籍(如有读者借了该书籍尚未归还,则不允许删除)5)可修改书籍的基本信息6)能够通过读者基本信息(包括:证号、姓名、性别、系名、年级)单个
3、或以AND方式组合多个条件查询读者信息7)关于每位读者除可查看其基本信息之外,还可查看其已借的书籍列表、数量、借还日期8)可增添新的读者9)可删除已有读者(如该读者有尚未归还的借书,则不允许删除)10)可修改读者的基本信息11)可完成借还书籍的手续12)还书时如超期,应该显示超期天数13)借书时假如有超期的书没有还,则不允许借书14)可查询有哪些读者有超期的书没有还,列出这些读者的基本信息三、实验的环境:1、硬件环境:P: Intel(R)Core i3230 2。6Hz RAM: GB、软件环境:操作系统:Widow ltmateSP1 编译软件:clipe Luna Microsoft Q
4、 Srver 2014四、系统E图五、表结构定义(使用表格说明)六、系统功能模块1)能够通过书籍基本信息单个或组合多个条件查询书籍信息;2)关于每一种书籍,除可查看其基本信息之外还可查看其总数以及目前在馆数量3)可增添新的书籍4)可删除已有书籍(如有读者借了该书籍尚未归还,则不允许删除)5)可修改书籍的基本信息6)能够通过读者基本信息单个或组合多个条件查询读者信息7)关于每位读者除可查看其基本信息之外,还可查看其已借的书籍列表、数量、借还日期8)可增添新的读者9)可删除已有读者(如该读者有尚未归还的借书,则不允许删除)10)可修改读者的基本信息11)可完成借还书籍的手续12)还书时如超期,应该
5、显示超期天数13)借书时假如有超期的书没有还,则不允许借书14)可查询有哪些读者有超期的书没有还,列出这些读者的基本信息七、程序框架流程图九、程序运行结果八、核心代码AdBo、avaipjav、awt、Borrayot;mpot jva、t、Container;importava。aw、GrdLayot;impo jaa、awt、event。*;mprt ja。ul。AryLis;ipo javax、swig、*;pulic class Addk extendsramepemens AcionListne QOert o = ne QOpertion(); Cntaerc=geConetPe(
6、);JPanel p newael(); JabelboNmbe= ew Lbel(BokNmr:);JLabel bookNme ne Jl(ookNam:); JLabel okAuhor = new JLabl(”ok Autho:); belpres =ew Jab(Prss:);Label esTme new e(Prss tie:);JLal oAbsract n Label(bstrac:); JLabel soe = nwbe(Storge:); Label reman=new JLael(”emain”);JLbl in nwJLabel(”Update with Sage”
7、);JexFiel numberieldnew JTextFid(); JTexFied namFed ew TexFild();JTetField athorField new JTtield();TextField prssField = ewJTeFiel(); TxtField presTieFed = nw JTextFld();Jtield absractld =ewJextField();JTexFielstrageFied ew Jxtied();JButton cace = new JButo(”ancel”); Jutncnfirm new Btto(Confim!”);
8、pcddook() c。ad(p1, orderLayout、NORTH); p1、setLayot(ew GridLyout(, 2, 2, 10);p、a(ookumber); p、ad(umberField);p1、ad(bokName);p1、d(namField); 1。dd(booAhr); 1、ad(autori);p1、add(press); 1、ad(pessid); p1。ad(presTime); p1、add(pressTFiel); 1、add(bokbtc); p1。add(atratFid); p、add(strage); p1、ad(soraeFeld); p、
9、a(reman); 1、ad(rmain1); 1、ad(cance); 1、add(cnfirm); ance。adAtionister(i); onfir。ddtinistener(this); ubli vi ctioPerormd(cioEvne) /TODO utoenred ethod sbi(e、etSource()= cancel) ths、dispose(); if (。getSource()= confir)his。dspose(); BokInfo kewookInfo(numrFil、gtText(), nmeFed。gtText(), authorFel、geTet(
10、), ressFiel、Txt(), presTmeield、getText(), abstractiel。gtTet(), Inegr、pareIn(srgeFiel 、getet(), Integr、parseI(storageFd、getxt(); rayListStri stry =nw AryListring(); strArry = o。adBooJudgent(); intn 0; nt replicate = ; wile (n Iteger、paseIt(stArray、gt(0) n+; if (umbried、getTex()、equas(stArray、get()rep
11、licate+; if (repcate = 0) op、saveBook(bok);OpionPae。swMesseaog(null, Adbook scessfly!, ”nfomtio,JOponPae、NFOMATIN_ESAGE); se OionPane、hoMeaeDiag(null, Thsook(numbr) hs lreadyexted!, Warning, JOptiPne、NFORMATION_MESSGE); Adead、javaimportjv、aw、oderLayot;impot va。awt、Ctaier;mot jva、aw、GridLayout;impot
12、jv。a、ent、;ipor java。util。rrayList; ja。swng、*;public cas Addedr extens ame imleets AoLitnr SLOperatinop new QOperaio();Cntaier = gtConentPane();anelp1 = neJael();JLbel radrumbr = ne JLael(”Rder Nube:”);JLael raderName= nw Jl(Reer Name:);JLbe sex = w JLabe(Sex:);JLabe pt = new Lbe(Depatent:”);JLaelgra
13、de JLab(Grade:”);JTxtFiednumberiel JTtFeld();TxtFie ameFiel ew JTxtFil(); JTetFiedexField ne Texiel(); JTetFe dptField newextFied(); JTeield gadFeld = JTextField(); Jtt cnel ne JBtn(ncel);JButtn confirm = newBuo(”Conir!”); public Addead() c。dd(p1, BrdLayout、NORTH); 1。etLou(new GridLayo(, 2,2, 1);、ad
14、d(radeNumbe); p1。ad(nerFied); p1、add(reaerNae); p1、add(naeFil); 、add(sx); p1。add(sxFied); 1、ad(dpt); p1。dd(dptFied);p1。d(gad); 1、(radeField);p1。d(cnel); p1、ad(cofrm); ccel、addAcionListener(ths);oni、adtionLitener(this); pl oi actinerfored(AcinEnt e) / TODO Autoeeted ethostubif (e、etuce()=cancel) thi、
15、dispe(); (e、getSore()= nfirm) this、dsos(); RederInfo reade= ewReaernfo(nuerFld。getext(), namFiel、etTex(),sxFild。gtTex(), dtFld、getTet(),Itege、reIn(adeied、getTxt(); AyLis trAay =new ArraistString(); strArray=。addeaderJudgement(); nn =0; nt rlicat= 0; we (nIntee、aret(strAray。et(0) +; i (numerield、getT
16、ext()。uals(trrry、get(n) rlicate+; if (rplicat = 0) i (!sexel、getTe()。equals(b) &!sexel。etxt()、ql(”girl) pionPan 、showesgeDalog( nul, te ex ied, you ca o iptboyor gi!”, ”Warning,JOptie、INFORMATIN_ESAGE); ele o、veeer(redr); JOtionPa、oMssageialog(ul, ”Ad rea succeuy!”, Information, Jton、INFATION_MESSAG
17、); else OtinPan、shwMeagiaog(ull, hi reader(uber)haalready existed!, ”Warin, pinPn。INFORMON_MESSAGE); BokDtails、javaimprt java。a。Borderayou;ortava、awt。Contine;mportjava。t。Diension;iport jva、awt、GrdLyut;importjava。a、vent、*;import ava。util、Aryit;iport ava、swing、;imort javax。swing、ble、DefalTableodel;ub
18、cls BookDeails exendsFrme imlementsAcnLstenr SQOerationo = newSQLOpeation(); Continerc = etCotntPne(); JPane p nePanel(); JPanel p = new JPel(); anel p3 nw JPael();Ll bookNmber = nw Lal(ook me:); JLablbookNam w JLabl(Book am:”);Jabl auhr= new JLabel(Auhor:”); JLabe ress= new JLel(Pes:);JLael prssTim
19、e= new JLel(”Pes tim:);JLbelbookbstract = neJbe(Atact:”);Labltore = new JLabel(”torage:);Jabl rmai= eJabel(”Remain:);JLabel nmberFil = newJLael(); Labl nameFild= newJLabel();Jabe authoFied = new JLabl(); JLabe ressFe = nwJLabel();JLaelpssmeFiel = new Jabel();JLael bsrctField =new JLabel();Jal sogeie
20、ld = new Jal();Jel remainField=new Lbel();Jutoncancel = new JBuo(an”); Jabeldtails nw Labe(Brow ad reurn dtail); Objects= ”eade nue”, ”Borrow time, Deadlne, ”Ovr tie; Object o1 = ne Obec74; Table tale = nJable(o1,s);ScolPne scrollane = new JScrllane(tale); ublic BookDel(tring nmbr) BooInf book = ne
21、ooInfo(numer); ob1 op、orLstFrBo(uber); fr( i 0; i 5; i) DefultblModl boks = ew DefauTaleModel(ob1, s); for (int = 0;n 7; n+) for (t = ; 4;m+) ob1nm th。b1nm; tbe、etModel(bo); tble。inaidate(); rayLittring strAray ewrystStrin();srArry = p、outuBok(book); numbeFil、setText(number); namFl。etT(srArra。ge(1);
22、 auorFeld、setex(stAray、g(2);pressField。tTx(strAy。get(3);pessTimeield、setex(srray。ge(); bstratl、setText(trra。get(5);stogeFild。stText(trAray、gt(6); remaiied。seText(strrray、ge(7); c、ad(p, Borerayu、NOH); c、(p, ordeyu。CNER); c、add(3, BorderLayt、SOUT); 1、setLayout(new Gridayou(9,2, 0, 0);1、add(okNumb);p。d
23、(numerField); p1、ad(ookName);p1、add(ameField); p。ad(autho); p1、a(uthorFel); 、add(pess);p1。ad(pessield); 。dd(pesTim); p1。add(pessTimFld); p。dd(booAstrct); p、a(absrFel); p1。add(stoge); p1、add(stoagil);1、add(rmai); p1、add(reaiFild);p1、ad(detail); sllPane、etBounds(0, 0,800, 300); p2。ad(scrllPan);p3、add(cancl); tale、stPrefrredScrolaeViewoSize(nwDimenson(400, 10);cancel、addctiLine(th
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1