版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、毕业论文课题名称: 图书管理系统学 号: 姓 名: 班 级: 院 系: 指导老师: 前言随着社会的发展,人们对于知识的需求也在不断地增长。书籍做为人们获取并增长知识的主要途径,使得图书馆在人们的生活中占有了一定位置。但是近几年来,随着藏书量不断的增长,造成了书库空间极度不足,图书挤压,管理不善。这些都直接影响了读者对图书馆藏书的充分利用。这时各个图书馆就特别需要开发一套图书馆管理系统,通过该系统来提高图书馆的管理效率,从而减少管理方面的工作流和成本。本系统针对图书馆的业务范围及工作特点,设计了用户客服端、读者管理、图书管理等三个大模块。这三个模块包括了图书馆的主要业务。用户客服端提供了个人信息
2、、借阅情况、查询书籍状态,读者管理模块提供了个人信息、借/还书、查询书籍状态,图书管理模块提供了采购、编目、检索、统计等业务的计算机管理。使图书馆管理水平和业务水平跃上一个新的台阶。应用本系统可以在计算机上灵活、方便地管理用户和图书,从而大大的提高了处理速率,使管理更加现代化。本系统是根据实际情况和具体内容,按照一定的要求,科学、合理的进行系统分析、设计,具体包括菜单设计、数据输入、查询、删除、个性等设计。从而使本系统完全能满足经济性、灵活性、系统性及可靠性的要求。目录第1章 概述1第2章 开发工具的选择2第3章 系统分析3第4章 系统设计4第5章 数据库分析与设计6第6章 图书管理系统具体实
3、现101.类设计102.普通用户登录模块113.普通用户注册144.普通用户登录184.1用户界面184.2查看个人信息和修改个人信息194.3用户预借图书界面254.4取消预借图书界面314.5用户借阅情况界面354.6用户续借图书界面384.7查询全部图书与部分查询图书界面424.8用户退出475.管理者登录模块485.1 管理用户界面485.2借阅图书界面515.3还书界面575.4超期罚款界面645.5图书管理界面665.6添加图书界面665.7修改图书界面695.8删除图书界面735.9预借删除及图书超期界面75第7章 总结79参考书目80第1章 概述早年的图书馆采用的都是手工操作的
4、管理方式,随着图书馆藏书种类的增长,藏书量的不断增加,读者群的不断增多,这种传统的管理方式,暴露出了许多的管理漏洞。随着计算机和网络技术在我国的快速发展,图书馆迫切需要一个能够实现自动化管理的管理系统。通过该系统能够实时显示图书的库存数量和种类信息,还能够对读者进行管理,还能够实时显示书籍的借阅情况和订购情况。通过系统来提高图书馆管理水平,同时提高工作效率。第2章 开发工具的选择一、NetBeans IDE是一个屡获殊荣的集成开发环境,可以方便的在Windows,Mac,Linux和Solaris中运行。NetBeans包括开源的开发环境和应用平台,NetBeans IDE可以使开发人员利用J
5、ava平台能够快速创建Web、企业、桌面以及移动的应用程序,NetBeans IDE目前支持PHP、Ruby、JavaScript、Ajax、Groovy、Grails和C/C+等开发语言。NetBeans项目由一个活跃的开发社区提供支持, NetBean开发环境提供了丰富的产品文档和培训资源以及大量的第三方插件。NetBeans是开源软件开发集成环境,是一个开放框架,可扩展的开发平台,可以用于Java、C/C+,PHP等语言的开发,本身是一个开发平台,可以通过扩展插件来扩展功能。在 NetBeans Platform 平台中,应用软体是用一系列的软体模组(Modular Software C
6、omponents)建构出来。而这些模组是一个jar档(Java Archive File)它包含了一组Java程式的类别而它们实作全依据依 NetBeans 定义了的公开介面以及一系列用来区分不同模组的定义描述档(Manifest File)。有赖於模组化带来的好处,用模组来建构的应用程式可只要加上新的模组就能进一步扩充。由於模组可以独立地进行开发,所以由 NetBeans 平台开发出来的应用程式就能利用着第三方软件,非常容易及有效率地进行扩充。第3章 系统分析一、需求分析图书馆管理系统是一个高度集成的图书信息处理系统,通过将图书管理的各种功能进行整合,从而达到高速检索信息、提高工作效率、降
7、低管理成本等目的。一个典型的图书馆管理系统应该能够管理所有的图书种类、图书信息以及读者信息,还需要提供各种图书信息的检索查询功能。该系统还需要能够对图书借阅、归还进行管理,并对读者的罚款进行自动计算。通过该系统的自动化管理,能够大大养活图书馆管理人员,还能减少管理人员的工作任务,从而降低管理开销和成本。二、功能分析图书馆管理系统是管理图书的一个重要工具,一个功能完善的图书馆管理系统需要提供5个功能模块,分别是图书类别管理模块、图书信息管理模块、读者信息管理模块、图书借阅管理模块,以及系统维护模块。其中各功能模块的具体说明如下。图书类别管理模块:该模块主要负责管理图书馆的图书种类信息,如图书种类
8、的名称、可借天数、罚款数目等信息。图书信息管理模块:该模块主要负责管理图书馆的图书信息,如图书编号、图书名称、作者、出版社等信息。读者信息管理模块:该模块主要负责管理图书馆的读者信息,如读者编号、读者信息、最大借书量等信息。图书借阅管理模块:该模块主要负责管理图书馆的书籍借阅和归还信息,包括图书借阅、图书归还、图书搜索3个子模块。系统维护模块:该模块主要负责管理图书馆的工作人员信息,包括用户管理和更改系统口令两个子模块。第4章 系统设计一、绘制用例图设计系统功能图书馆管理系统是一个内部售货员使用的系统,也就是说不是所有人都能够使用它,只有图书馆的工作人员才能使用。操作员,主要负责图书的借阅和归
9、还的工作;还能够对书籍列表、书籍信息、读者信息等进行管理。下面以普通用户和管理员为例绘制其所对应的用例图。二、绘制系统流程图本系统首先需要对用户的身份进行识别,只有合法的用户才能进入系统;否则将无法进入系统。进入系统后,首先打开系统主窗体,在系统首页的菜单栏或者功能区可以选择各种导航链接来进行各种操作。由于不同权限的用户对于系统有不同的功能。其普通用户系统流程图如图所示。其管理者系统流程图如图所示。第5章 数据库分析与设计1数据库分析在开发图书管理系统时,考虑到图书量大,数据维护大的特点,决定采用SQL Server 2000作为数据库管理系统。在SQL Server中新增一个数据库,其数据库
10、名为l。数据库中一共包含6张表,储存不同的信息详细如图所示。2.数据库概念设计读者超期罚金表(book_overtime)学号罚金(1)读者超期罚金实体ER图(2) 图书借阅信息实体ER图图书状态图书借阅信息表(BR)学号图书编号图书名称作者借书时间图书是否有超期还书时间(3)管理员信息实体ER图管理员信息表(Manege)账号密码(4)图书状态实体ER图图书状态表(status)学号图书编号图书状态(5)图书信息实体ER图图书借阅信息表(tushu)图书价格图书编号图书名称作者出版社(6)学生信息实体ER图学生信息信息表(U)学号姓名性别密码是否有罚款3.数据库逻辑结构设计(1)读者超期罚金
11、表(book_overtime),表结构如下表所示:(2)图书借阅信息表(BR),表结构如下表所示:(3)管理员信息实体表(Manege),表结构如下表所示:(4)图书状态表(status),表结构如下表所示:(5)图书信息表(tushu),表结构如下表所示:(6)学生信息表(U),表结构如下表所示:4.绘制表之间关系E-R图第6章 图书管理系统具体实现1.类设计设计学生及图书公共类,数据库连接类,文本框限制长度类。学生及图书公共类public class TuShu public TuShu() public String userid;/学号public String book_id;/条
12、型码public String book_name;/图书名称public String br_time;/借书时间public String book_return;/应还时间public String br_status;/图书状态public String author;/作者public String p_name;/出版社名public String p_price;/价格public String overdue_book;/是否有超期图书public String book_overtime;public String book_NumberOfTimes;/预借次数public
13、 String book_Choose;/判断是否选择图书数据库连接类public class DAO protected static String dbCLassName="com.microsoft.jdbc.sqlserver.SQLServerDriver" protected static String dbURL="jdbc:microsoft:sqlserver:/localhost:1433;DatabaseName=l" private static Connection conn; private String user="
14、;sa" private String password="" private DAO() tryif (conn=null)Class.forName(dbCLassName); conn=DriverManager.getConnection(dbURL,user,password);catch(Exception e)e.printStackTrace(); public static ResultSet executeQuery(String sql) try if(conn=null) new DAO(); return conn.createState
15、ment(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE).executeQuery(sql);/鍒涘缓鎵瀵硅薄catch(SQLException e) e.printStackTrace(); return null; public static int executeUpdate(String sql) try if(conn=null) new DAO(); Statement stat=conn.createStatement(); return stat.executeUpdate(sql);catch(SQLE
16、xception e) e.printStackTrace(); return -1; public static void close() tryconn.close();catch(SQLException e) e.printStackTrace();finallyconn=null; 文本框限制长度类public class DocumentSizeFilter extends DocumentFilterprivate int maxLength; public DocumentSizeFilter(int maxLength) this.maxLength=maxLength; O
17、verride public void insertString (FilterBypass fb,int offset,String string,AttributeSet attrs)throws BadLocationException if(fb.getDocument().getLength()+string.length()<=maxLength) super.insertString(fb, offset, string,(javax.swing.text.AttributeSet) attrs); elseToolkit.getDefaultToolkit().beep(
18、); Override public void replace (FilterBypass fb,int offset,int length,String string,AttributeSet attrs)throws BadLocationException if(fb.getDocument().getLength()+string.length()<=maxLength) super.replace(fb, offset, length, string,(javax.swing.text.AttributeSet) attrs); elseToolkit.getDefaultTo
19、olkit().beep();2.普通用户登录模块 用户账号非数字的报错系统登录界面代码:public class User extends javax.swing.JFrame implements ActionListener,ItemListener,FocusListener,KeyListenerstatic private String Username;static private String Manegename;public User() initComponents(); this.setLocationRelativeTo(this); jTextField1.setT
20、ext(""); jPasswordField1.setText(""); jButton1.addActionListener(this); jButton2.addActionListener(this); jComboBox1.addItemListener(this); jButton4.addActionListener(this); jPasswordField1.addFocusListener(this); jTextField1.addFocusListener(this); jLabel4.setText("");
21、 jPasswordField1.addKeyListener(this); AbstractDocument TextField1=(AbstractDocument)jTextField1.getDocument(); AbstractDocument PasswordField1=(AbstractDocument)jPasswordField1.getDocument(); TextField1.setDocumentFilter(new DocumentSizeFilter(12); /设置文本长度12 PasswordField1.setDocumentFilter(new Doc
22、umentSizeFilter(12); public static String UserName() return Username; public static void main(String args) java.awt.EventQueue.invokeLater(new Runnable() public void run() new User().setVisible(true); ); public void actionPerformed(ActionEvent e) if(e.getSource()=jButton2) /登录按钮 int Select=jComboBox
23、1.getSelectedIndex(); String pwd = null; pwd=String.valueOf(jPasswordField1.getPassword().trim(); if(Select=0)/普通用户登录 try Long.valueOf(jTextField1.getText().trim(); Username=jTextField1.getText().trim(); String sql="select * from U where userid='"+Username+"'" ; ResultSet
24、 result=DAO.executeQuery(sql); try if (result.next() String repwd; repwd=result.getString(4); if(pwd.equals(repwd.trim() UserJFram newmain = new UserJFram(); newmain.setVisible(true); this.setVisible(false); else JOptionPane.showMessageDialog(null, "密码出错!",null,2); else JOptionPane.showMes
25、sageDialog(null, "用户账号不存在!",null,2); catch (SQLException ex) ex.printStackTrace(); catch(NumberFormatException ex) JOptionPane.showMessageDialog(null, "用户号必须是数字!",null,2); if(Select=1)/管理者登录 try Long.valueOf(jTextField1.getText().trim(); Manegename=jTextField1.getText().trim(); S
26、tring sql="select * from Manege where ManegeID='"+Manegename+"'" ; ResultSet result=DAO.executeQuery(sql); try if (result.next() String repwd; repwd=result.getString(2); if(pwd.equals(repwd.trim() ChooseJFrame newmain = new ChooseJFrame(); newmain.setVisible(true); this.s
27、etVisible(false); else JOptionPane.showMessageDialog(null, "密码出错!",null,2); else JOptionPane.showMessageDialog(null, "管理者账号不存在!",null,2); catch (SQLException ex) ex.printStackTrace(); catch(NumberFormatException ex) JOptionPane.showMessageDialog(null, "用户号必须是数字!",null,2
28、); if(e.getSource()=jButton4) zhuche u=new zhuche(); u.setVisible(true); if(e.getSource()=jButton1) jTextField1.setText(""); jPasswordField1.setText(""); Override public void itemStateChanged(ItemEvent e) if(e.getSource()=jComboBox1) if(jComboBox1.getSelectedIndex()=1) jButton4.s
29、etVisible(false); else jButton4.setVisible(true); Override public void focusGained(FocusEvent e) if(e.getSource()=jPasswordField1) try jLabel4.setText(""); if(jTextField1.getText().equals("")jLabel4.setText("用户号不能为空!"); else Long.valueOf(jTextField1.getText().trim(); ca
30、tch(NumberFormatException ex) jLabel4.setText("用户号必须是数字!"); Override public void focusLost(FocusEvent e) if(e.getSource()=jTextField1) try jLabel4.setText(""); if(jTextField1.getText().equals("")jLabel4.setText("用户号不能为空!"); else Long.valueOf(jTextField1.getTex
31、t().trim(); catch(NumberFormatException ex) jLabel4.setText("用户号必须是数字!"); Override public void keyTyped(KeyEvent e) Override public void keyPressed(KeyEvent e) Override public void keyReleased(KeyEvent e) if(e.getSource()=jPasswordField1) if(e.getKeyCode()=10)jButton2.doClick(); 3.普通用户注册 由
32、于没有账号先进行“注册”,进入注册界面。 单击“确定”注册成功,数据库有刚刚注册用户的信息。 如果重复注册则会报错或如果注册的密码位数不在610之间则会提示出错! “注册”界面的代码public class zhuche extends javax.swing.JFrame implements ActionListener,FocusListener,ItemListener String userid="",repassword="", userpassword="" ;/用户学号 public zhuche() initComp
33、onents(); this.setLocationRelativeTo(this); this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); jTextField1.setText(""); jTextField2.setText(""); jPasswordField1.setText(""); jPasswordField2.setText(""); jTextField4.setText(""); jLabel11.setText(
34、""); jLabel12.setText(""); jLabel13.setText(""); jButton1.addActionListener(this); jButton2.addActionListener(this); jButton3.addActionListener(this); jTextField1.addFocusListener(this); jRadioButton1.setSelected(true); jRadioButton1.addItemListener(this);jRadioButton2.
35、addItemListener(this);jRadioButton1.setSelected(true);jPasswordField1.addFocusListener(this);jPasswordField2.addFocusListener(this);AbstractDocument TextField1=(AbstractDocument)jTextField1.getDocument(); /设置文本长度12AbstractDocument TextField2=(AbstractDocument)jTextField2.getDocument(); /设置文本长度12Abst
36、ractDocument TextField4=(AbstractDocument)jTextField4.getDocument(); /设置文本长度12 AbstractDocument PasswordField1=(AbstractDocument)jPasswordField1.getDocument(); AbstractDocument PasswordField2=(AbstractDocument)jPasswordField2.getDocument(); TextField1.setDocumentFilter(new DocumentSizeFilter(12); Te
37、xtField4.setDocumentFilter(new DocumentSizeFilter(12); TextField2.setDocumentFilter(new DocumentSizeFilter(20); PasswordField1.setDocumentFilter(new DocumentSizeFilter(12); PasswordField2.setDocumentFilter(new DocumentSizeFilter(12);public static void main(String args) java.awt.EventQueue.invokeLate
38、r(new Runnable() public void run() new zhuche().setVisible(true); ); public void actionPerformed(ActionEvent e) String interest="",address,username,sex; if(e.getSource()=jButton3) User a=new User(); a.setVisible(true); this.setVisible(false); if(e.getSource()=jButton1) jTextField1.setText(
39、""); jTextField2.setText(""); jPasswordField1.setText(""); jPasswordField2.setText(""); jTextField4.setText(""); jLabel11.setText(""); jLabel12.setText(""); jLabel13.setText(""); if(jCheckBox1.isSelected()jCheckBox1.setS
40、elected(false);if(jCheckBox2.isSelected()jCheckBox2.setSelected(false);if(jCheckBox3.isSelected()jCheckBox3.setSelected(false);if(jCheckBox4.isSelected()jCheckBox4.setSelected(false);if(jCheckBox5.isSelected()jCheckBox5.setSelected(false); jRadioButton1.setSelected(true); if(e.getSource()=jButton2)
41、username=jTextField4.getText();/分别获得用户名,性别,地址,性别的值 if(jRadioButton1.isSelected()sex="男"else sex="女" address=jTextField2.getText().trim();if(jCheckBox1.isSelected()interest=interest+"网游"if(jCheckBox2.isSelected()interest=interest+"书法"if(jCheckBox3.isSelected()i
42、nterest=interest+"体育"if(jCheckBox4.isSelected()interest=interest+"音乐"if(jCheckBox5.isSelected()interest=interest+"其它" if(userpassword.length()>=6&&userpassword.length()<=12&& repassword.length()>=6&&repassword.length()<=12)/验证口令长度 if(
43、userpassword.equals(repassword) if (jLabel11.getText().equals("正确") if(jLabel11.getText().equals("已注册")JOptionPane.showMessageDialog(null, "学号已注册,请另外输入");else String sql="update u set userpassword='"+userpassword+"',username='"+username+&
44、quot;',sex='"+sex+"',address='"+address+"',interest='"+interest+"'where userid='"+userid+"'" int k=DAO.executeUpdate(sql); if(k=1)JOptionPane.showMessageDialog(null, "注册成功"); jTextField1.setText("");
45、 jTextField2.setText(""); jPasswordField1.setText(""); jPasswordField2.setText(""); jTextField4.setText(""); jLabel11.setText(""); jLabel12.setText(""); jLabel13.setText(""); if(jCheckBox1.isSelected()jCheckBox1.setSelected(false)
46、;if(jCheckBox2.isSelected()jCheckBox2.setSelected(false);if(jCheckBox3.isSelected()jCheckBox3.setSelected(false);if(jCheckBox4.isSelected()jCheckBox4.setSelected(false);if(jCheckBox5.isSelected()jCheckBox5.setSelected(false); jRadioButton1.setSelected(true); else JOptionPane.showMessageDialog(null,
47、"学号不存在,请另外输入"); else JOptionPane.showMessageDialog(null, "密码不一致",null,2); else JOptionPane.showMessageDialog(null, "密码长度必须是612位!",null,2); Override public void focusLost(FocusEvent e) if(e.getSource()=jTextField1) userid=jTextField1.getText().trim(); String sql=null; sq
48、l="select * from U where userid='"+userid+"'" ResultSet result=DAO.executeQuery(sql); try if (result.next() /判断学号是否存在 String password=result.getString(2); if(password!=null)JOptionPane.showMessageDialog(null, "学号已注册,请另外输入");jLabel11.setText("已注册"); els
49、e jLabel11.setText("正确"); /判断学号是否注册过else jLabel11.setText("请输入正确的学号!"); catch (SQLException ex) ex.printStackTrace();if(e.getSource()=jPasswordField1) userpassword =String.valueOf(jPasswordField1.getPassword().trim(); /判断密码是否是612位 if(userpassword.length()>=6&&userpassword.length()<=12) jLabel12.setText(""); else jLabel12.setText("密码是612位!"); if(e.getSource()=jPasswordField2)/判断前后密码是否一致 repassword =String.valueOf(jPasswordField2.getPassword()
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 少儿口才启蒙课件
- 江南文化美学解析课件
- 超声科甲状腺超声检查注意事项
- 健康评估笔记软件
- 2025版全科医学疾病常见症状及护理手册
- 装修补充协议书
- 2025-2026学年北京市昌平区八年级英语上册期中考试试卷及答案
- 2025年湘教版高二历史上册月考考试试题及答案
- 西师版八年级生物上册月考考试试题及答案
- 学校让交就业协议书
- 膝关节损伤术后康复运动康复方案设计
- 医保法律法规培训
- 挫而不折破茧成蝶高一主题班会课件
- 新版苏教版三年级数学上册《间隔排列》教案
- 物流配送责任免除协议条款
- MRI常见伪影简介课件
- 安全工器具的检查及使用培训
- 中国黄酒酿造技术单选题100道及答案
- 前列腺癌内分泌治疗护理
- 低压电工安全技术培训
- 中国婴幼儿 科学配餐与食品制作指导手册
评论
0/150
提交评论