ImageVerifierCode 换一换
格式:DOCX , 页数:46 ,大小:1.16MB ,
资源ID:5185566      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/5185566.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(图书管理系统实验报告+源代码.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

图书管理系统实验报告+源代码.docx

1、图书管理系统实验报告+源代码图书信息管理系统课程设计: 图书信息管理系统设计人员: 林俊柱 开发环境: eclipse数据库: sql server 2005说明: 数据库里面的用户名为”sa”, 密码为:”1111” 登录程序所用的用户名为: ljz ,密码为: 0000,当然,也可以使用注册功能,注册完成后使用自己的用户名和密码登录 设计思路:该图书信息管理系统主要便于图书管理员管理教师的书籍借阅情况。该程序实现的功能总共有五个板块:1、教师信息管理: 包含了增加、删除、修改、查询教师信息等功能;2、图书信息管理: 包含了增加、删除、修改、查询图书信息等功能;3、借书登记: 登记教师借阅图

2、书的相关信息;4、还书登记: 登记教师归还图书的相关信息;5、催还: 查询出并列出教师借阅图书超过期限的相关信息,以便催促教师还书.数据库的设计思路为:Teacher(读者号,姓名,性别,年龄,部门,联系方式)Book(ISBN,书名,作者,出版社,价格,类型)Borrow(读者号,ISBN ,借阅日期,归还日期,办理人,归还办理人) (横线为主键,蓝色字体为外键)管理员信息表:Administrator(管理员编号,管理员密码,管理员姓名,性别,年龄,联系电话)数据库的连接:public class Dataclass private static Connection conn = nul

3、l; String driverName = com.microsoft.sqlserver.jdbc.SQLServerDriver; String dbURL = jdbc:sqlserver:/localhost:1433;DatabaseName=Java课程设计数据库 ; String userName=sa; /默认用户名 String userPwd=1111; /密码 /构造函数 public Dataclass() /用于连接数库 try if (conn = null) Class.forName(driverName); conn = DriverManager.getC

4、onnection(dbURL, userName, userPwd); else return; catch (Exception e) /捕获数据库连接不成功异常 e.printStackTrace(); public static ResultSet executeQuery(String sql) /传送返回结果集的SQL语句 try if(conn=null) new Dataclass(); /调用构造函数连接数据库 return conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATA

5、BLE).executeQuery(sql); /返回可滚动的并发事件 catch (SQLException e) /捕获访问数据库失败异常 e.printStackTrace(); return null; public static boolean executeUpdate(String sql) /发送不返回结果集的SQL语句 try if(conn=null) new Dataclass(); /调用构造函数连接数据库 int i = conn.createStatement().executeUpdate(sql); if(i != 0) return true; catch (

6、SQLException e) /捕获访问数据库失败异常 System.out.println(e.getMessage(); return false; /不成功返回-1 return false; public static void close() /断开数据库连接方法 try conn.close(); catch (SQLException e) e.printStackTrace(); finally conn = null; /设置数据库连接对象为空 登录界面的实现:代码为:public class KCSJDL extends JFrame JTextField textFie

7、ld1; JPasswordField textField2; public KCSJDL() try/ 设置Windows观感 UIManager.setLookAndFeel(com.sun.java.swing.plaf.windows.WindowsLookAndFeel); catch(Exception e) System.out.println(Look and Feel Exception); System.exit(0); setTitle(图书管理系统登录界面); setBounds(400, 200, 376, 300); setResizable(false); Con

8、tainer con=getContentPane(); JLabel lblNewLabel = new JLabel(); lblNewLabel.setIcon(new ImageIcon(images/head.jpg); JPanel Jpanel1 = new JPanel(); Jpanel1.setLayout(new GridLayout(2, 1, 0, 0); JPanel Jpanel1_1 = new JPanel(); Jpanel1_1.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 30); Jpanel1.add(

9、Jpanel1_1); JLabel lblNewLabel2 = new JLabel( 管理员编号:); Jpanel1_1.add(lblNewLabel2); textField1 = new JTextField(); Jpanel1_1.add(textField1); textField1.setColumns(25); JPanel Jpanel1_2 = new JPanel(); Jpanel1_2.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 20); Jpanel1.add(Jpanel1_2); JLabel label

10、_1 = new JLabel( 管理员密码:); Jpanel1_2.add(label_1); textField2 = new JPasswordField(); Jpanel1_2.add(textField2); textField2.setColumns(25); JPanel Jpanel2 = new JPanel(); JLabel label = new JLabel( ); JButton button1 = new JButton( 登录 ); JButton button2 = new JButton( 注册 ); Jpanel2.add(label); Jpanel

11、2.add(button1); Jpanel2.add(button2); con.add(lblNewLabel,North); con.add(Jpanel1,Center); con.add(Jpanel2,South); textField1.addActionListener(new KCSJDLEvent(this); textField2.addActionListener(new KCSJDLEvent(this); button1.addActionListener(new KCSJDLEvent(this); button2.addActionListener(new KC

12、SJDLEvent(this); public static void main(String args) KCSJDL test = new KCSJDL(); test.setVisible(true); test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 注册界面的实现:代码为:public class KCSJZC extends JFrame private ButtonGroup buttonGroup = new ButtonGroup(); JTextField textField1_1; JTextField textFi

13、eld2_1; JTextField textField3_1; JTextField textField4_1; JTextField textField4_2; JRadioButton radioButton1; JRadioButton radioButton2; public KCSJZC() try/ 设置Windows观感 UIManager.setLookAndFeel(com.sun.java.swing.plaf.windows.WindowsLookAndFeel); catch(Exception e) System.out.println(Look and Feel

14、Exception); System.exit(0); setTitle(注册); setBounds(400, 200,500,550); setResizable(false); Container con=getContentPane(); JLabel lblNewLabel = new JLabel(); lblNewLabel.setIcon(new ImageIcon(images/ZC.png); con.add(lblNewLabel,North); JPanel Jpanel = new JPanel(); Jpanel.setBorder(new TitledBorder

15、(null, 管理员注册, TitledBorder.CENTER, TitledBorder.TOP, null, null); Jpanel.setLayout(new GridLayout(5, 1, 0, 0); con.add(Jpanel,Center); JPanel J1 = new JPanel(); J1.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 20); Jpanel.add(J1); JLabel lb1_1 = new JLabel(管理员编号:); textField1_1 = new JTextField();

16、textField1_1.setColumns(20); JLabel lb1_2 = new JLabel( ); J1.add(lb1_1); J1.add(textField1_1); J1.add(lb1_2); JPanel J2 = new JPanel(); J2.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 20); Jpanel.add(J2); JLabel lb2_1 = new JLabel(管理员密码:); textField2_1 = new JTextField(); textField2_1.setColumns(

17、20); JLabel lb2_2 = new JLabel( 确认密码:); JTextField textField2_2 = new JTextField(); textField2_2.setColumns(20); J2.add(lb2_1); J2.add(textField2_1); J2.add(lb2_2); J2.add(textField2_2); JPanel J3 = new JPanel(); J3.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 20); Jpanel.add(J3); JLabel lb3_1 = n

18、ew JLabel(管理员姓名:); textField3_1 = new JTextField(); textField3_1.setColumns(20); JLabel lb3_2 = new JLabel( 性 别:); radioButton1 = new JRadioButton( 男);/ buttonGroup.add(radioButton1); JLabel lb3_3 = new JLabel( ); radioButton2 = new JRadioButton( 女); buttonGroup.add(radioButton2); J3.add(lb3_1); J3.

19、add(textField3_1); J3.add(lb3_2); J3.add(radioButton1); J3.add(lb3_3); J3.add(radioButton2); JPanel J4 = new JPanel(); J4.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 20); Jpanel.add(J4); JLabel lb4_1 = new JLabel(年 龄 :); textField4_1 = new JTextField(); textField4_1.setColumns(20); JLabel lb4_2 =

20、 new JLabel( 联系电话:); textField4_2 = new JTextField(); textField4_2.setColumns(20); J4.add(lb4_1); J4.add(textField4_1); J4.add(lb4_2); J4.add(textField4_2); JPanel J5 = new JPanel(); J5.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 20); Jpanel.add(J5); JButton Jb1 = new JButton( 注册 ); Jb1.setIcon(n

21、ew ImageIcon(images/JY.png); Jb1.addActionListener(new enrollEvent(this); JButton Jb2 = new JButton(返回登录界面); Jb2.setIcon(new ImageIcon(images/GH.png); Jb2.addActionListener(new enrollEvent(this); J5.add(Jb1); J5.add(Jb2); 首页界面的实现:代码为:class KCSJMain extends JFrame JButton Jbutton = new JButton6; JPan

22、el Jpanel; JPanel Jpanel1; JPanel Jpanel2; JPanel Jpanel3; JPanel Jpanel4; JPanel Jpanel5; JTextField textField_1; JTextField textField_2; JTextField textField_3; JTextField textField_4; JTextField textField_5; public KCSJMain() try/ 设置Windows观感 UIManager.setLookAndFeel(com.sun.java.swing.plaf.windo

23、ws.WindowsLookAndFeel); catch(Exception e) System.out.println(Look and Feel Exception); System.exit(0); setTitle(图书管理系统); setBounds(150, 150, 950, 620); setResizable(false); Container con=getContentPane(); String str = 首页 ,教师信息管理,图书信息管理, 借书登记 , 还书登记 , 催还 ; String Pfilename = images/c6.png,images/p1.

24、png,images/p2.png,images/p3.png,images/p4.png,images/p5.png; for(int i = 0;i str.length;i+) Jbuttoni = new JButton(stri); Jbuttoni.setIcon(new ImageIcon(Pfilenamei); Jbuttoni.setHorizontalTextPosition(JButton.CENTER); Jbuttoni.setVerticalTextPosition(JButton.BOTTOM); JPanel panel = new JPanel(); pan

25、el.setBorder(new LineBorder(Color.LIGHT_GRAY); for(int i = 0;i str.length;i+) panel.add(Jbuttoni); /左边 JPanel jpanel = new JPanel(); jpanel.setBorder(new LineBorder(Color.LIGHT_GRAY); jpanel.setLayout(new BoxLayout(jpanel, BoxLayout.Y_AXIS); JPanel panel_1 = new JPanel(); panel_1.setBorder(new Title

26、dBorder(UIManager.getBorder(TitledBorder.border), 欢迎使用图书管理系统, TitledBorder.CENTER, TitledBorder.TOP, null, new Color(0, 0, 0); jpanel.add(panel_1); JTextArea textArea = new JTextArea(); textArea.setColumns(30); textArea.setRows(5); textArea.setText(【功能简要介绍】:n 该系统可以对教师读者以及图 n 书进行管理,包括增删改查等功能n ,方便于管理,

27、是管理员的小小n 助手!); textArea.setBackground(SystemColor.control); textArea.setEditable(false); panel_1.add(textArea); JPanel panel_2 = new JPanel(); panel_2.setBorder(new TitledBorder(null, 您好,欢迎登录图书管理系统, TitledBorder.CENTER, TitledBorder.TOP, null, null); jpanel.add(panel_2); JPanel jp = new JPanel(); jp

28、.setLayout(new GridLayout(5, 1, 0, 0); panel_2.add(jp); String str1 = 管理员编号:,管理员姓名:, 性别: , 年龄: , 联系电话: ; JPanel JP = new JPanelstr1.length; JLabel label = new JLabelstr1.length; for(int i = 0;i str1.length;i+) JPi = new JPanel(); labeli= new JLabel(str1i); JPi.add(labeli); jp.add(JPi); textField_1 = new JTextField(); textField_1.setColumns(20); JP0.add(textField_1); textField_2 = new JTextField(); textField_2.setColumns(20); JP1.add(textField_2); textField_3 = new JTextField(); textField_3.setColumns

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1