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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

JAVA课程设计基于UI的图书管理系统.docx

1、JAVA课程设计基于UI的图书管理系统JAVA课程设计报告(图书管理系统)1. 系统目的与功能(1)本系统通链接ACCESS完成对用户信息和图书信息的管理,并制作可视化界面进行操作。(2)系统主要实现的功能有用户的登陆,图书的插入、修改、删除、查看、借阅、归还。2. 开发工具开发工具使用Eclipse作为主用开发环境,并使用VE相关制作系统界面部分。3. 系统说明(以下名字都是类名)1. Access类来进行界面切换,数据库操作等。2. MainMenu、Regsdit类是系统登陆界面和用户注册界面。3. MainCl类是系统的主要界面。4. Insert、Look、Update、Delete

2、、Sendbook、Backbook类分别用来进行图书插入、图书信息查看、图书信息修改、图书删除、借阅图书、归还图书。5. 程序代码Access类package access;import java.sql.*;importimportimportimport view.*;public class Access Connection conn = null; Statement stmt = null; ResultSet rs = null; PreparedStatement ps = null; String username; String temp; String password

3、; String bookname; String bookid; String author; String publisher; String name; int count; JTextField test; JTextField test1; JLabel jLabel; JPanel jpane; int result=0; public Access(String username, String password) this.username = username; this.password = password; try Class.forName(); String str

4、url = jdbc:odbc:driver=Microsoft Access Driver (*.mdb);DBQ=D:workspacebookmis.mdb; conn = DriverManager.getConnection(strurl); stmt = conn.createStatement(); catch (Exception e) public Access(String bookname,String bookid,String author,String publisher,JTextField test) this.bookname=bookname; this.b

5、ookid=bookid; this.author=author; this.publisher=publisher; this.test=test; try Class.forName(); String strurl = jdbc:odbc:driver=Microsoft Access Driver (*.mdb);DBQ=D:workspacebookmis.mdb; conn = DriverManager.getConnection(strurl); stmt = conn.createStatement(); catch (Exception e) public Access(S

6、tring bookname,String bookid,String author,String publisher,JLabel jlabel) this.bookname=bookname; this.bookid=bookid; this.author=author; this.publisher=publisher; this.jLabel=jlabel; try Class.forName(); String strurl = jdbc:odbc:driver=Microsoft Access Driver (*.mdb);DBQ=D:workspacebookmis.mdb; c

7、onn = DriverManager.getConnection(strurl); stmt = conn.createStatement(); catch (Exception e) public Access() try Class.forName(); String strurl = jdbc:odbc:driver=Microsoft Access Driver (*.mdb);DBQ=D:workspacebookmis.mdb; conn = DriverManager.getConnection(strurl); stmt = conn.createStatement(); c

8、atch (Exception e) public Access(String temp,JTextField test1) this.temp=temp; this.test1=test1; try Class.forName(); String strurl = jdbc:odbc:driver=Microsoft Access Driver (*.mdb);DBQ=D:workspacebookmis.mdb; conn = DriverManager.getConnection(strurl); stmt = conn.createStatement(); catch (Excepti

9、on e) public Access(String aname,JPanel jpane,JLabel jLabel) name=aname; this.jpane=jpane; this.jLabel=jLabel; try Class.forName(); String strurl = jdbc:odbc:driver=Microsoft Access Driver (*.mdb);DBQ=D:workspacebookmis.mdb; conn = DriverManager.getConnection(strurl); stmt = conn.createStatement();

10、catch (Exception e) public Access(String aname,JLabel jLabel) name=aname; this.jLabel=jLabel; try Class.forName(); String strurl = jdbc:odbc:driver=Microsoft Access Driver (*.mdb);DBQ=D:workspacebookmis.mdb; conn = DriverManager.getConnection(strurl); stmt = conn.createStatement(); catch (Exception

11、e) public void regsdit() try result=stmt.executeUpdate(insert into userinform(username,password) values(+username+,+password+); catch (SQLException e) / TODO 自动生成 catch 块 new Fail().getJDialog(); if (result = 1) MainMenu mainmenu = new MainMenu(); mainmenu.getJFrame(); else public void login() try r

12、s=stmt.executeQuery(select * from userinform where username=+username+ and password=+password+); if(rs.next() MainCl maincl =new MainCl(); maincl.getJFrame(); else LoginFail loginfail=new LoginFail(); loginfail.getJDialog(); catch (SQLException e) / TODO 自动生成 catch 块 e.printStackTrace(); public void

13、 insert() try result=stmt.executeUpdate(insert into bookmis(bookname,num,auther,publisher) values(+bookname+,+bookid+,+author+,+publisher+); catch (SQLException e) / TODO 自动生成 catch 块 e.printStackTrace(); if(result=1) test.setText(插入成功); else test.setText(插入失败); public void look() Look alook =new Lo

14、ok(); try rs = stmt.executeQuery(select * from bookmis); while (rs.next() bookname=rs.getString(bookname); bookid=rs.getString(num); author=rs.getString(auther); publisher=rs.getString(publisher); count=rs.getInt(count); String acount=Integer.toString(count); String temp=书名: +bookname+ 编号: +bookid+

15、作者: +author+ 出版社: +publisher+ 数量:+acount; alook.getList().add(temp); alook.getJFrame(); alook.getList().add(nnnn); catch(Exception e) public void delete() tryresult=0; result=stmt.executeUpdate(delete from bookmis where bookname=+temp+); catch(Exception e) if(result=1) test1.setText(删除成功); else test

16、1.setText(删除失败,你输入的书名有误); public void update() try rs = stmt.executeQuery(select * from bookmis where bookname=+name+); if(rs.next() stmt.executeUpdate(delete from bookmis where bookname=+name+); jpane.setVisible(true); else jLabel.setText(请输入正确的书名); catch (SQLException e) public void aupdate() try

17、result=stmt.executeUpdate(insert into bookmis(bookname,num,auther,publisher) values(+bookname+,+bookid+,+author+,+publisher+); catch (SQLException e) / TODO 自动生成 catch 块 e.printStackTrace(); if(result=1) jLabel.setText(修改成功); else jLabel.setText(修改失败); public void sendbook() try rs = stmt.executeQue

18、ry(select * from bookmis where bookname=+name+); if(rs.next() int bcount=rs.getInt(count); if(bcount=0) jLabel.setText(书已经全部借完);return; stmt.executeUpdate(update bookmis set count=count-1 where bookname=+name+); jLabel.setText(借阅成功); else jLabel.setText(没有这本书); catch (SQLException e) e.printStackTra

19、ce(); public void backbook() try stmt.executeUpdate(update bookmis set count=count+1 where bookname=+name+); jLabel.setText(还书成功); catch (SQLException e) MainMenu类package view;importimportimportimportimportimportimportimport access.Access;importpublic class MainMenu private JFrame jFrame = null; / j

20、ve:decl-index=0:visual-constraint=159,78 private JPanel jContentPane = null; private JLabel jLabel = null; private JTextField jTextField = null; private JLabel jLabel1 = null; private JButton jButton = null; private JButton jButton1 = null; private JPasswordField jPasswordField = null; /* * This met

21、hod initializes jFrame * * return */ public JFrame getJFrame() if (jFrame = null) jFrame = new JFrame(); jFrame.setSize(new Dimension(461, 320); jFrame.setTitle(图书管理系统登陆界面); jFrame.setContentPane(getJContentPane(); jFrame.setVisible(true); return jFrame; /* * This method initializes jContentPane * *

22、 return */ private JPanel getJContentPane() if (jContentPane = null) jLabel1 = new JLabel(); jLabel1.setBounds(new Rectangle(30, 121, 167, 30); jLabel1.setText( 密 码); jLabel = new JLabel(); jLabel.setBounds(new Rectangle(30, 45, 167, 31); jLabel.setText( 用户名); jContentPane = new JPanel(); jContentPa

23、ne.setLayout(null); jContentPane.add(jLabel, null); jContentPane.add(getJTextField(), null); jContentPane.add(jLabel1, null); jContentPane.add(getJButton(), null); jContentPane.add(getJButton1(), null); jContentPane.add(getJPasswordField(), null); return jContentPane; /* * This method initializes jT

24、extField * * return */ private JTextField getJTextField() if (jTextField = null) jTextField = new JTextField(); jTextField.setBounds(new Rectangle(211, 44, 223, 35); return jTextField; /* * This method initializes jButton * * return */ private JButton getJButton() if (jButton = null) jButton = new J

25、Button(); jButton.setBounds(new Rectangle(61, 211, 121, 32); jButton.setText(登陆); jButton.addActionListener(newr() public void String username=jTextField.getText(); String password=jPasswordField.getText(); Access access=new Access(username,password); access.login(); jFrame.setVisible(false); ); ret

26、urn jButton; /* * This method initializes jButton1 * * return */ private JButton getJButton1() if (jButton1 = null) jButton1 = new JButton(); jButton1.setBounds(new Rectangle(269, 210, 139, 32); jButton1.setText(注册); jButton1.addActionListener(new public void Regsdit regsdit=new Regsdit(); regsdit.g

27、etJFrame(); jFrame.setVisible(false); ); return jButton1; /* * This method initializes jPasswordField * * return */ private JPasswordField getJPasswordField() if (jPasswordField = null) jPasswordField = new JPasswordField(); jPasswordField.setBounds(new Rectangle(211, 121, 225, 29); return jPasswordField; public static void main(String a) MainMenu mainmenu=new MainMenu(); mainmenu.getJFrame(); MainCl类package view;importimportimportimportimport ja

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

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