当前位置:首页 >> 工学 >>

Java 图书馆管理系统(附全代码)


《数据库系统概论》课程报告

课题名称: 小型图书管理系统

课题负责人名(学号) : best

同组成员名单(角色) :

指导教师: 评阅成绩: 评阅意见:

提交报告时间: 2015 年 12 月 15 日

课程名称:数据库系统概论

/>小型图书管理系统

计算机科学与技术专业

学生指导老师

[ 摘要 ]

随着计算机技术的飞速发展,利用计算机来获得和处理信息是当

今信息管理的一大特点。伴随计算机硬件的快速发展,有关信息管理的软件— —数据库系统软件也在迅猛发展着。图书馆是高等院校的重要组成部门,是教 师和学生获取知识的重要场所。由于图书馆主要从事大量的图书资料的储存和 流通。所以一直以来,计算机在图书馆的图书管理中得到了广泛的应用。本系 统实现图书信息管理的系统化,规范化和自动化,以最大程度提高操作人员的 办公效率。

关键词: JAVA 、 JDBC、 SQL Server、数据库、图书馆管理

-1-

课程名称:数据库系统概论

一、实验题目:小型图书管理系统

二、实验的目的和要求 : 完成一个小型图书管理系统,功能要求如下: 1) 能够通过书籍基本信息(包括:书号、书名、出版社、出版日 期、作者、内容摘要)单个或以 AND 方式组合多个条件查询书籍 信息; 2) 对于每一种书籍, 除可查看其基本信息之外还可查看其总数以 及目前在馆数量 3) 可增添新的书籍 4) 可删除已有书籍(如有读者借了该书籍尚未归还,则不允许删 除) 5) 可修改书籍的基本信息 6) 能够通过读者基本信息(包括:证号、姓名、性别、系名、年 级)单个或以 AND 方式组合多个条件查询读者信息 7) 对于每位读者除可查看其基本信息之外, 还可查看其已借的书 籍列表、数量、借还日期 8) 可增添新的读者 9) 可删除已有读者 (如该读者有尚未归还的借书, 则不允许删除) 10) 可修改读者的基本信息

-2-

课程名称:数据库系统概论

11) 可完成借还书籍的手续 12) 还书时如超期,应该显示超期天数 13) 借书时如果有超期的书没有还,则不允许借书 14) 可查询有哪些读者有超期的书没有还, 列出这些读者的基本信 息

三、实验的环境: 1、硬件环境: CPU:Intel(R) Core i5-3230 2.60GHz RAM:8GB 2、软件环境:操作系统: Windows 7 Ultimate SP1 编译软件: Eclipse Luna Microsoft SQL Server 2014

四、系统 ER 图

-3-

课程名称:数据库系统概论

添加读者 删除读者 删除图书 修改读者

添加图书 用户名 密码

权限
修改图书

拥有

管理员

编号 书名

编号 姓名 性别 年级

管理

管理

作者 出版社

读者

借阅

图书

出版时间 摘要 总量

系名

超期时间

应还时间

借阅时间 现存量

五、表结构定义(使用表格说明)

-4-

课程名称:数据库系统概论

-5-

课程名称:数据库系统概论

-6-

课程名称:数据库系统概论

六、系统功能模块 1) 能够通过书籍基本信息单个或组合多个条件查询书籍信息; 2) 对于每一种书籍, 除可查看其基本信息之外还可查看其总数以
-7-

课程名称:数据库系统概论

及目前在馆数量 3) 可增添新的书籍 4) 可删除已有书籍(如有读者借了该书籍尚未归还,则不允许删 除) 5) 可修改书籍的基本信息 6) 能够通过读者基本信息单个或组合多个条件查询读者信息 7) 对于每位读者除可查看其基本信息之外, 还可查看其已借的书 籍列表、数量、借还日期 8) 可增添新的读者 9) 可删除已有读者 (如该读者有尚未归还的借书, 则不允许删除) 10) 可修改读者的基本信息 11) 可完成借还书籍的手续 12) 还书时如超期,应该显示超期天数 13) 借书时如果有超期的书没有还,则不允许借书 14) 可查询有哪些读者有超期的书没有还, 列出这些读者的基本信 息

七、程序框架流程图

-8-

课程名称:数据库系统概论

登录

主界面

图书管理

读者管理

借阅列表

增 加 书 籍

编 辑 书 籍

删 除 书 籍

组 合 查 询

借 阅 书 籍

归 还 书 籍

增 加 读 者

编 辑 读 者

删 除 读 者

组 合 查 询

详 细 信 息

详 细 信 息

-9-

课程名称:数据库系统概论

九、程序运行结果

-10-

课程名称:数据库系统概论

-11-

课程名称:数据库系统概论

-12-

课程名称:数据库系统概论

-13-

课程名称:数据库系统概论

八、核心代码

AddBook.java

import import import import import

java.awt.BorderLayout; java.awt.Container; java.awt.GridLayout; java.awt.event.*; java.util.ArrayList;

import javax.swing.*;

-14-

课程名称:数据库系统概论

publicclassAddBookextends JFrame implements ActionListener { SQLOperation op = new SQLOperation(); Container c = getContentPane(); JPanel p1 = new JPanel(); JLabel bookNumber = new JLabel("Book Number:"); JLabel bookName = new JLabel("Book Name:"); JLabel bookAuthor = new JLabel("Book Author:"); JLabel press = new JLabel("Press:"); JLabel pressTime = new JLabel("Press time:"); JLabel bookAbstract = new JLabel("Abstract:"); JLabel storage = new JLabel("Storage:"); JLabel remain = new JLabel("Remain"); JLabel remain1 = new JLabel("Update with Storage"); JTextFieldnumberField = newJTextField(); JTextFieldnameField = newJTextField(); JTextFieldauthorField = newJTextField(); JTextFieldpressField = newJTextField(); JTextFieldpressTimeField = newJTextField(); JTextFieldabstractField = newJTextField(); JTextFieldstorageField = newJTextField(); JButton cancel = new JButton("Cancel"); JButton confirm = new JButton("Confirm!!"); public AddBook() { c.add(p1, BorderLayout.NORTH); p1.setLayout(new GridLayout(9, 2, 20, 10)); p1.add(bookNumber); p1.add(numberField); p1.add(bookName); p1.add(nameField); p1.add(bookAuthor); p1.add(authorField); p1.add(press); p1.add(pressField); p1.add(pressTime); p1.add(pressTimeField); p1.add(bookAbstract); p1.add(abstractField); p1.add(storage); p1.add(storageField);
-15-

课程名称:数据库系统概论

p1.add(remain); p1.add(remain1); p1.add(cancel); p1.add(confirm); cancel.addActionListener( this); confirm.addActionListener(this); } publicvoid actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if (e.getSource() == cancel) { this.dispose(); } if (e.getSource() == confirm) { this.dispose(); BookInfo book = new BookInfo(numberField.getText(), nameField.getText(), authorField.getText(), pressField.getText(), pressTimeField.getText(), abstractField.getText(), Integer.parseInt(storageField .getText()), Integer.parseInt(storageField.getText())); ArrayList<String>strArray = new ArrayList<String>(); strArray = op.addBookJudgement(); intn = 0; intreplicate = 0; while (n< Integer.parseInt (strArray.get(0))) { n++; if (numberField.getText().equals(strArray.get(n))) { replicate++; } } if (replicate == 0) { op.saveBook(book); JOptionPane.showMessageDialog (null, "Add a book successfully! ",
-16-

课程名称:数据库系统概论

"Information", JOptionPane.INFORMATION_MESSAGE ); } else { JOptionPane.showMessageDialog (null, "This book(number) has already existed!", "Warning", JOptionPane.INFORMATION_MESSAGE ); } } } }

AddReader.java
import import import import import java.awt.BorderLayout; java.awt.Container; java.awt.GridLayout; java.awt.event.*; java.util.ArrayList;

import javax.swing.*; publicclassAddReaderextends JFrame implements ActionListener { SQLOperation op = new SQLOperation(); Container c = getContentPane(); JPanel p1 = new JPanel(); JLabel readerNumber = new JLabel("Reader Number:"); JLabel readerName = new JLabel("Reader Name:");
-17-

课程名称:数据库系统概论

JLabel sex = new JLabel("Sex:"); JLabel dpt = new JLabel("Department:"); JLabel grade = new JLabel("Grade:"); JTextField numberField = new JTextField(); JTextField nameField = new JTextField(); JTextField sexField = new JTextField(); JTextField dptField = new JTextField(); JTextField gradeField = new JTextField(); JButton cancel = new JButton("Cancel"); JButton confirm = new JButton("Confirm!!"); public AddReader() { c.add(p1, BorderLayout.NORTH); p1.setLayout(new GridLayout(6, 2, 20, 10)); p1.add(readerNumber); p1.add(numberField); p1.add(readerName); p1.add(nameField); p1.add(sex); p1.add(sexField); p1.add(dpt); p1.add(dptField); p1.add(grade); p1.add(gradeField); p1.add(cancel); p1.add(confirm); cancel.addActionListener( this); confirm.addActionListener(this); } publicvoid actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if (e.getSource() == cancel) { this.dispose(); } if (e.getSource() == confirm) { this.dispose(); ReaderInfo reader = newReaderInfo(numberField.getText(),
-18-

课程名称:数据库系统概论

nameField.getText(), sexField.getText(), dptField.getText(), Integer.parseInt(gradeField.getText())); ArrayList<String>strArray = new ArrayList<String>(); strArray = op.addReaderJudgement(); intn = 0; intreplicate = 0; while (n< Integer.parseInt (strArray.get(0))) { n++; if (numberField.getText().equals(strArray.get(n))) { replicate++; } } if (replicate == 0) { if (!sexField.getText().equals("boy") && !sexField.getText().equals("girl")) { JOptionPane .showMessageDialog( null, "In the Sex field, you can only input 'boy' or 'girl'! ", "Warning", JOptionPane.INFORMATION_MESSAGE ); } else { op.saveReader(reader); JOptionPane.showMessageDialog (null, "Add a reader successfully ! ", "Information", JOptionPane.INFORMATION_MESSAGE ); } } else { JOptionPane.showMessageDialog (null, "This reader(number) has already existed!", "Warning", JOptionPane.INFORMATION_MESSAGE ); } }

-19-

课程名称:数据库系统概论

} }

BookDetails.java import java.awt.BorderLayout; import java.awt.Container; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.event.*; import java.util.ArrayList; import javax.swing.*; import javax.swing.table.DefaultTableModel; publicclassBookDetailsextends JFrame implements ActionListener { SQLOperation op = new SQLOperation(); Container c = getContentPane(); JPanel p1 = new JPanel(); JPanel p2 = new JPanel(); JPanel p3 = new JPanel(); JLabel JLabel JLabel JLabel JLabel JLabel JLabel JLabel JLabel JLabel JLabel JLabel JLabel bookNumber = new JLabel("Book Number:"); bookName = new JLabel("Book Name:"); author = new JLabel("Author:"); press = new JLabel("Press:"); pressTime = new JLabel("Press time:"); bookAbstract = new JLabel("Abstract:"); storage = new JLabel("Storage:"); remain = new JLabel("Remain:"); numberField = new JLabel(); nameField = new JLabel(); authorField = new JLabel(); pressField = new JLabel(); pressTimeField = new JLabel();
-20-

课程名称:数据库系统概论

JLabel abstractField = new JLabel(); JLabel storageField = new JLabel(); JLabel remainField = new JLabel(); JButton cancel = new JButton("Cancel"); JLabel details = new JLabel("Borrow and reaturn details"); Object[] s = { "Reader number", "Borrow time", "Deadline", "Over time" }; Object[][] ob1 = new Object[7][4]; JTable table = new JTable(ob1, s); JScrollPane scrollPane = new JScrollPane(table); public BookDetails(String number) { BookInfo book = new BookInfo(number); ob1 = op.borrowListForBook(number); for (inti = 0; i< 5; i++) { DefaultTableModel books = new DefaultTableModel(ob1, s); for (intn = 0; n< 7; n++) { for (intm = 0; m< 4; m++) { ob1[n][m] = this.ob1[n][m]; } table.setModel(books); table.invalidate(); } } ArrayList<String>strArray = new ArrayList<String>(); strArray = op.outputBook(book); numberField.setText(number); nameField.setText(strArray.get(1)); authorField.setText(strArray.get(2)); pressField.setText(strArray.get(3)); pressTimeField.setText(strArray.get(4)); abstractField.setText(strArray.get(5)); storageField.setText(strArray.get(6)); remainField.setText(strArray.get(7)); c.add(p1, BorderLayout.NORTH); c.add(p2, BorderLayout.CENTER); c.add(p3, BorderLayout.SOUTH); p1.setLayout(new GridLayout(9, 2, 20, 10)); p1.add(bookNumber);
-21-

课程名称:数据库系统概论

p1.add(numberField); p1.add(bookName); p1.add(nameField); p1.add(author); p1.add(authorField); p1.add(press); p1.add(pressField); p1.add(pressTime); p1.add(pressTimeField); p1.add(bookAbstract); p1.add(abstractField); p1.add(storage); p1.add(storageField); p1.add(remain); p1.add(remainField); p1.add(details); scrollPane.setBounds(0, 0, 800, 300); p2.add(scrollPane); p3.add(cancel); table.setPreferredScrollableViewportSize( new Dimension(400, 100)); cancel.addActionListener( this); } publicvoid actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if (e.getSource() == cancel) { this.dispose(); } } }

BookInfo.java
-22-

课程名称:数据库系统概论

publicclass BookInfo { private String number, name, author, press, pressTime, bookAbstract; privateinttotal, remain; // default constructor public BookInfo() { } public BookInfo(String number) { this.number = number; } public BookInfo(String number, String name) { this.number = number; this.name = name; } public BookInfo(String number, String name, String author, String press, String pressTime, String bookAbstract, inttotal, intremain) { this.number = number; this.name = name; this.author = author; this.press = press; this.pressTime = pressTime; this.bookAbstract = bookAbstract; this.total = total; this.remain = remain; } publicvoid setRemain(inti) { this.remain=i; } public String getNumber() { returnnumber; } public String getName() { returnname;
-23-

课程名称:数据库系统概论

} public String getAuthor() { returnauthor; } public String getPress() { returnpress; } public String getPressTime() { returnpressTime; } public String getBookAbstract() { returnbookAbstract; } publicint getTotal() { returntotal; } publicint getRemain() { returnremain; } }

BookRetrieval.java import java.awt.BorderLayout; import java.awt.Container; import java.awt.Dimension; import java.awt.Font; import java.awt.GridLayout;
-24-

课程名称:数据库系统概论

import java.awt.event.*; import java.util.ArrayList; import javax.swing.*; import javax.swing.table.DefaultTableModel; classBookRetrievalextends JFrame implements ActionListener { SQLOperation op = new SQLOperation(); Container c = getContentPane(); JPanel p1 = new JPanel(); JPanel p4 = new JPanel(); JPanel p5 = new JPanel(); JLabel bookNumber = new JLabel("Book Number:"); JLabel bookName = new JLabel("Book Name:"); JTextField number = new JTextField(); JTextField name = new JTextField(); JButton back = new JButton("Back (Fresh)"); JButton addBook = new JButton("Add a book"); JButton deleteBook = new JButton("Delete a book"); JButton editBook = new JButton("Edit a book"); JButton search = new JButton("Search for details!"); JButton borrowBook = new JButton("Borrow a book"); JButton returnBook = new JButton("Return a book"); Font font1 = new Font("00", Font.BOLD, 20); Object[] s = { "Number", "Name", "Author", "Press", "Press Time", "Abstract", "Storage", "Remain" }; Object[][] ob = new Object[40][8]; JTable table = new JTable(ob, s); JScrollPane scrollPane = new JScrollPane(table); public BookRetrieval() { BookInfo book = new BookInfo(); ob = op.allBook(book); for (inti = 0; i< 5; i++) { DefaultTableModel books = new DefaultTableModel(ob, s); for (intn = 0; n< 20; n++) { for (intm = 0; m< 8; m++) { ob[n][m] = this.ob[n][m];
-25-

课程名称:数据库系统概论

} table.setModel(books); table.invalidate(); } } c.add(p4, BorderLayout.NORTH); c.add(p1, BorderLayout.CENTER); c.add(p5, BorderLayout.SOUTH); search.setFont(font1); p4.setLayout(new GridLayout(2, 4, 20, 10)); p4.add(back); p4.add(addBook); p4.add(editBook); p4.add(deleteBook); p4.add(borrowBook); p4.add(returnBook); p1.setLayout(null); scrollPane.setBounds(0, 0, 800, 300); p1.add(scrollPane); p5.setLayout(new GridLayout(5, 1, 0, 0)); p5.add(bookNumber); p5.add(number); p5.add(bookName); p5.add(name); p5.add(search); table.setPreferredScrollableViewportSize( new Dimension(400, 300)); addBook.addActionListener(this); search.addActionListener( this); back.addActionListener(this); deleteBook.addActionListener(this); editBook.addActionListener(this); borrowBook.addActionListener(this); returnBook.addActionListener(this); } publicvoid actionPerformed(ActionEvent e) { if (e.getSource() == search) { ArrayList<String>strArray = new ArrayList<String>();
-26-

课程名称:数据库系统概论

strArray = op.addBookJudgement(); String s1 = number.getText(); String s2 = name.getText(); intn = 0; intreplicate = 0; while (n< Integer.parseInt (strArray.get(0))) { n++; if (s1.equals(strArray.get(n))) { replicate++; } } ArrayList<String>strArray1 = new ArrayList<String>(); strArray1 = op.addBookJudgement1(); intn1 = 0; intreplicate1 = 0; while (n1< Integer.parseInt(strArray1.get(0))) { n1++; if (s2.equals(strArray1.get(n1))) { replicate1++; } } if (replicate == 0 &&replicate1 == 0) { JOptionPane.showMessageDialog (null, "Please input a correct book number or name!", "Warning", JOptionPane.INFORMATION_MESSAGE ); } elseif (replicate != 0 || replicate1 != 0) { if (replicate == 0 &&replicate1 != 0) { BookInfo book = new BookInfo(s1, s2); String s = op.searchBookByName(book); BookDetails f = new BookDetails(s); // f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Book Details"); f.setLocation(300, 200); f.setSize(480, 470); f.setVisible(true);

-27-

课程名称:数据库系统概论

} elseif (replicate != 0) { BookDetails f = new BookDetails(s1); // f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Book Details"); f.setLocation(300, 200); f.setSize(480, 470); f.setVisible(true); } } } if (e.getSource() == back) { this.dispose(); MyFrame f = new MyFrame(); // f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Library Management System"); f.setLocation(300, 200); f.setSize(580, 300); f.setVisible(true); } if (e.getSource() == addBook) { AddBook f = new AddBook(); // f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Add a book"); f.setLocation(300, 200); f.setSize(300, 400); f.setVisible(true); } if (e.getSource() == deleteBook) { DeleteBook f = new DeleteBook(); // f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Delete a book"); f.setLocation(300, 200); f.setSize(300, 200); f.setVisible(true);
-28-

课程名称:数据库系统概论

} if (e.getSource() == borrowBook) { BorrowBook f = new BorrowBook(); // f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Borrow a book"); f.setLocation(300, 200); f.setSize(300, 200); f.setVisible(true); } if (e.getSource() == returnBook) { ReturnBook f = new ReturnBook(); // f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Return a book"); f.setLocation(300, 200); f.setSize(300, 200); f.setVisible(true); } if (e.getSource() == editBook) { SelectEdit f = new SelectEdit(); // f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Edit a book"); f.setLocation(300, 200); f.setSize(300, 200); f.setVisible(true); } } }

BorrowBook.java import java.awt.BorderLayout; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.*; import java.util.ArrayList;
-29-

课程名称:数据库系统概论

import javax.swing.*; publicclassBorrowBookextends JFrame implements ActionListener { SQLOperation op = new SQLOperation(); Container c = getContentPane(); JPanel p1 = new JPanel(); JLabel bookNumber = new JLabel("Book Number:"); JTextField numberField = new JTextField(); JLabel readerNumber = new JLabel("Reader Number:"); JTextField readerNumberField = new JTextField(); JButton cancel = new JButton("Cancel"); JButton borrow = new JButton("Borrow!!"); public BorrowBook() { c.add(p1, BorderLayout.NORTH); p1.setLayout(new GridLayout(3, 2, 20, 10)); p1.add(bookNumber); p1.add(numberField); p1.add(readerNumber); p1.add(readerNumberField); p1.add(cancel); p1.add(borrow); cancel.addActionListener( this); borrow.addActionListener( this); } publicvoid actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if (e.getSource() == cancel) { this.dispose(); } if (e.getSource() == borrow) { String bookNumber = numberField.getText(); ArrayList<String>strArray = new ArrayList<String>(); strArray = op.addBookJudgement(); intn = 0;
-30-

课程名称:数据库系统概论

intreplicate = 0; while (n< Integer.parseInt (strArray.get(0))) { n++; if (bookNumber.equals(strArray.get(n))) { replicate++; } } String readerNumber = readerNumberField.getText(); ArrayList<String>strArray1 = new ArrayList<String>(); strArray1 = op.addReaderJudgement(); intn1 = 0; intreplicate1 = 0; while (n1< Integer.parseInt(strArray1.get(0))) { n1++; if (readerNumber.equals(strArray1.get(n1))) { replicate1++; } } if (replicate == 0 || replicate1 == 0) { JOptionPane .showMessageDialog( null, "Please input a correct book number and a reader number!", "Warning", JOptionPane.INFORMATION_MESSAGE ); } else { BookInfo book = new BookInfo(bookNumber); ArrayList<String>s = new ArrayList<String>(); s = op.outputBook(book); if (Integer.parseInt (s.get(7)) > 0) { ints1 = op.reBorrowCheck(numberField.getText(), readerNumberField.getText()); if (s1 == 1) { JOptionPane
-31-

课程名称:数据库系统概论

.showMessageDialog( null, "You have borrowed this book, can not reborrow it!", "Unsuccessful", JOptionPane.INFORMATION_MESSAGE ); } else { longcurrentTime = System.currentTimeMillis(); if (op.deadLineCheck(readerNumberField.getText(), currentTime) != 0) { JOptionPane .showMessageDialog( null, "You have exceeded the deadline, please return these books first!", "Unsuccessful", JOptionPane.INFORMATION_MESSAGE ); } else { BookInfo book1 = new BookInfo(s.get(0), s.get(1), s.get(2), s.get(3), s.get(4), s.get(5), Integer.parseInt(s.get(6)), Integer.parseInt(s.get(7)) 1); op.inputBook(book1); String borrowTime = Long.toString(System .currentTimeMillis()); String deadline = Long.toString(System .currentTimeMillis() + 2592000000l); System.out.println(borrowTime); System.out.println(deadline); op.insertBorrow(numberField.getText(),
-32-

课程名称:数据库系统概论

readerNumberField.getText(), borrowTime, deadline); JOptionPane .showMessageDialog( null, "Borrowed this book successfully, you have 30 days to enjoy this book!", "Successful", JOptionPane.INFORMATION_MESSAGE ); } } } else { JOptionPane.showMessageDialog (null, "This book has been borrowed!", "Unsuccessful", JOptionPane.INFORMATION_MESSAGE ); } } this.dispose(); } } }

BorrowList.Java import java.awt.BorderLayout; import java.awt.Container; import java.awt.Dimension; importjava.awt.Font; importjava.awt.GridLayout; import java.awt.event.*; importjava.util.ArrayList; import javax.swing.*;
-33-

课程名称:数据库系统概论

import javax.swing.table.DefaultTableModel; publicclassBorrowListextends JFrame implements ActionListener { SQLOperation op = new SQLOperation(); Container c = getContentPane(); JPanel p1 = new JPanel(); JPanel p2 = new JPanel(); JButton back=new JButton("Back"); Object[] s = { "Book number", "Reader number", "Borrow time", "Deadline","OverTime"}; Object[][] ob = new Object[100][5]; JTable table = new JTable(ob, s); JScrollPane scrollPane = new JScrollPane(table); public BorrowList() { // TODO Auto-generated constructor stub Object[][] ob1 = op.borrowList(); for (inti = 0; i< 5; i++) { DefaultTableModel list = new DefaultTableModel(ob, s); for (intn = 0; n< 100; n++) { for (intm = 0; m< 5; m++) { ob[n][m] = ob1[n][m]; } table.setModel(list); table.invalidate(); } } c.add(p1, BorderLayout.CENTER); c.add(p2,BorderLayout.SOUTH); scrollPane.setBounds(0, 0, 800, 300); p1.add(scrollPane); p2.add(back); table.setPreferredScrollableViewportSize( new Dimension(400, 400)); back.addActionListener(this);

}
-34-

课程名称:数据库系统概论

publicvoid actionPerformed(ActionEvent e) { if (e.getSource() == back) { this.dispose(); MyFrame f = new MyFrame(); f.setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE ); f.setTitle("Library Management System"); f.setLocation(300, 200); f.setSize(580, 300); f.setVisible(true); } // TODO Auto-generated method stub } }

Date.java import java.text.DateFormat; import java.text.SimpleDateFormat; publicclass Date { public Date(){ } static String borrowTimeInterface( longtime) { SimpleDateFormat df = (SimpleDateFormat) DateFormat.getInstance(); df.applyPattern("yyyy-MM-dd"); String s = df.format(time); returns; } }

-35-

课程名称:数据库系统概论

DeleteBook.java import java.awt.BorderLayout; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.*; import javax.swing.*; publicclassDeleteBookextends JFrame implements ActionListener { SQLOperation op = new SQLOperation(); Container c = getContentPane(); JPanel p1 = new JPanel(); JLabel bookNumber = new JLabel("Book Number:"); JTextField numberField = new JTextField(); JButton cancel = new JButton("Cancel"); JButton delete = new JButton("Delete!!"); public DeleteBook() { c.add(p1, BorderLayout.NORTH); p1.setLayout(new GridLayout(2, 2, 20, 10)); p1.add(bookNumber); p1.add(numberField); p1.add(cancel); p1.add(delete); cancel.addActionListener( this); delete.addActionListener( this); } publicvoid actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if (e.getSource() == cancel) { this.dispose(); } if (e.getSource() == delete) { BookInfo book = new BookInfo(numberField.getText()); this.dispose(); if (op.deleteBookCheck(numberField.getText()) != 0) {
-36-

课程名称:数据库系统概论

JOptionPane .showMessageDialog( null, "Delete the book unsuccessfully. The book bas been borrowed!", "Warning", JOptionPane.INFORMATION_MESSAGE ); } else { if (op.deleteBook(book) == 1) { JOptionPane.showMessageDialog (null, "Delete the book successfully ! ", "Information", JOptionPane.INFORMATION_MESSAGE ); } else { JOptionPane .showMessageDialog( null, "Delete the book unsuccessfully. The book does not exist!", "Warning", JOptionPane.INFORMATION_MESSAGE ); } } } } }

DeleteReader.java import java.awt.BorderLayout; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.*;

-37-

课程名称:数据库系统概论

import javax.swing.*; publicclassDeleteReaderextends JFrame implements ActionListener { SQLOperation op = new SQLOperation(); Container c = getContentPane(); JPanel p1 = new JPanel(); JLabel readerNumber = new JLabel("Reader Number:"); JTextField numberField = new JTextField(); JButton cancel = new JButton("Cancel"); JButton delete = new JButton("Delete!!"); public DeleteReader() { c.add(p1, BorderLayout.NORTH); p1.setLayout(new GridLayout(2, 2, 20, 10)); p1.add(readerNumber); p1.add(numberField); p1.add(cancel); p1.add(delete); cancel.addActionListener( this); delete.addActionListener( this); } publicvoid actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if (e.getSource() == cancel) { this.dispose(); } if (e.getSource() == delete) { ReaderInfo reader = new ReaderInfo(numberField.getText()); this.dispose(); if (op.deleteReaderCheck(numberField.getText()) != 0) { JOptionPane .showMessageDialog( null, "Delete the reader unsuccessfully. Please return books first!", "Warning",
-38-

课程名称:数据库系统概论

JOptionPane.INFORMATION_MESSAGE ); } else { if (op.deleteReader(reader) == 1) { JOptionPane.showMessageDialog (null, "Delete the reader successfully ! ", "Information", JOptionPane.INFORMATION_MESSAGE ); } else { JOptionPane .showMessageDialog( null, "Delete the reader unsuccessfully. The reader does not exist!", "Warning", JOptionPane.INFORMATION_MESSAGE ); } } } } }

EditBook.java import java.awt.BorderLayout; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.*; import java.util.ArrayList; import javax.swing.*; publicclassEditBookextends JFrame implements ActionListener { SQLOperation op = new SQLOperation(); Container c = getContentPane(); JPanel p1 = new JPanel();

-39-

课程名称:数据库系统概论

JLabel bookNumber = new JLabel("Book Number:"); JLabel bookName = new JLabel("Book Name:"); JLabel author = new JLabel("Book Author:"); JLabel press = new JLabel("Press:"); JLabel pressTime = new JLabel("Press time:"); JLabel bookAbstract = new JLabel("Abstract:"); JLabel storage = new JLabel("Storage:"); JLabel remain = new JLabel("Remain:"); JLabel remain1 = new JLabel("Update with storage"); JLabel numberField = new JLabel(); JTextField nameField = new JTextField(); JTextField authorField = new JTextField(); JTextField pressField = new JTextField(); JTextField pressTimeField = new JTextField(); JTextField abstractField = new JTextField(); JTextField storageField = new JTextField(); JTextField temp1 = new JTextField(); JTextField temp2 = new JTextField(); JButton cancel = new JButton("Cancel"); JButton save = new JButton("Save!!"); public EditBook(String number) { BookInfo book = new BookInfo(number); ArrayList<String>strArray = new ArrayList<String>(); strArray = op.outputBook(book); numberField.setText(number); nameField.setText(strArray.get(1)); authorField.setText(strArray.get(2)); pressField.setText(strArray.get(3)); pressTimeField.setText(strArray.get(4)); abstractField.setText(strArray.get(5)); storageField.setText(strArray.get(6)); temp1.setText(strArray.get(6)); temp2.setText(strArray.get(7)); c.add(p1, BorderLayout.NORTH); p1.setLayout(new GridLayout(9, 2, 20, 10)); p1.add(bookNumber); p1.add(numberField);
-40-

课程名称:数据库系统概论

p1.add(bookName); p1.add(nameField); p1.add(author); p1.add(authorField); p1.add(press); p1.add(pressField); p1.add(pressTime); p1.add(pressTimeField); p1.add(bookAbstract); p1.add(abstractField); p1.add(storage); p1.add(storageField); p1.add(remain); p1.add(remain1); p1.add(cancel); p1.add(save); cancel.addActionListener( this); save.addActionListener(this); } publicvoid actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if (e.getSource() == cancel) { this.dispose(); } if (e.getSource() == save) { inti = Integer.parseInt (storageField.getText()) - Integer.parseInt(temp1.getText()) + Integer.parseInt(temp2.getText()); BookInfo book = new BookInfo(numberField.getText(), nameField.getText(), authorField.getText(), pressField.getText(), pressTimeField.getText(), abstractField.getText(), Integer.parseInt(storageField .getText()), i); op.inputBook(book);
-41-

课程名称:数据库系统概论

JOptionPane.showMessageDialog (null, "Edit the book successfully! ", "Information", JOptionPane.INFORMATION_MESSAGE ); this.dispose(); } } }

EditReader.java import java.awt.BorderLayout; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.*; import java.util.ArrayList; import javax.swing.*; publicclassEditReaderextends JFrame implements ActionListener { SQLOperation op = new SQLOperation(); Container c = getContentPane(); JPanel p1 = new JPanel(); JLabel readerNumber = new JLabel("Reader Number:"); JLabel readerName = new JLabel("Reader Name:"); JLabel sex = new JLabel("Sex:"); JLabel dpt = new JLabel("Department:"); JLabel grade = new JLabel("Grade:"); JLabel numberField = new JLabel(); JTextField nameField = new JTextField(); JTextField sexField = new JTextField(); JTextField dptField = new JTextField(); JTextField gradeField = new JTextField(); JButton cancel = new JButton("Cancel"); JButton save = new JButton("Save!!"); public EditReader(String number) {
-42-

课程名称:数据库系统概论

numberField.setText(number); ReaderInfo reader = new ReaderInfo(number); ArrayList<String>strArray = new ArrayList<String>(); strArray = op.outputReader(reader); System.out.println(strArray); numberField.setText(number); nameField.setText(strArray.get(1)); sexField.setText(strArray.get(2)); dptField.setText(strArray.get(3)); gradeField.setText(strArray.get(4)); c.add(p1, BorderLayout.NORTH); p1.setLayout(new GridLayout(6, 2, 20, 10)); p1.add(readerNumber); p1.add(numberField); p1.add(readerName); p1.add(nameField); p1.add(sex); p1.add(sexField); p1.add(dpt); p1.add(dptField); p1.add(grade); p1.add(gradeField); p1.add(cancel); p1.add(save); cancel.addActionListener( this); save.addActionListener(this); } publicvoid actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if (e.getSource() == cancel) { this.dispose(); } if (e.getSource() == save) { ReaderInfo reader = newReaderInfo(numberField.getText(), nameField.getText(), sexField.getText(), dptField.getText(),
-43-

课程名称:数据库系统概论

Integer.parseInt(gradeField.getText())); if (!sexField.getText().equals("boy") && !sexField.getText().equals("girl")) { JOptionPane .showMessageDialog( null, "In the Sex field, you can only input 'boy' or 'girl'! ", "Warning", JOptionPane.INFORMATION_MESSAGE ); } else { op.inputReader(reader); JOptionPane.showMessageDialog (null, "Edit the book successfully ! ", "Information", JOptionPane.INFORMATION_MESSAGE ); this.dispose(); } } } }

HomePage.java import java.awt.BorderLayout; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.*; import javax.swing.*; import java.awt.Font; publicclass HomePage { }

-44-

课程名称:数据库系统概论

classMyFrameextends JFrame implements ActionListener { Container c = getContentPane(); JPanel p1 = new JPanel(); JPanel p2 = new JPanel(); JPanel p3 = new JPanel(); JLabel welcome = new JLabel("Welcome to my library management system"); JLabel space = new JLabel(" "); JLabel space1 = new JLabel(" "); JButtonbook = newJButton("Book Retrieval"); JButtonreader = newJButton("Reader Retrieval"); JButtonlist = newJButton("Borrow List"); Font font1 = new Font("00", Font.BOLD, 20); Font font2 = new Font("00", Font.ITALIC , 20); public MyFrame() { c.add(p1, BorderLayout.CENTER); c.add(p2, BorderLayout.EAST); c.add(p3, BorderLayout.WEST); p2.add(space); p3.add(space1); p1.setLayout(new GridLayout(4, 1, 50, 50)); p1.add(welcome); p1.add(book); p1.add(reader); p1.add(list); welcome.setFont(font2); book.setFont(font1); reader.setFont(font1); list.setFont(font1); list.addActionListener(this); book.addActionListener(this); reader.addActionListener( this); } publicvoid actionPerformed(ActionEvent e) { if (e.getSource() == book) { this.dispose(); BookRetrieval page1 = new BookRetrieval();

-45-

课程名称:数据库系统概论

page1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); page1.setTitle("Book Retrieval"); page1.setLocation(200, 100); page1.setSize(815, 600); page1.setVisible(true ); } if (e.getSource() == reader) { this.dispose(); ReaderRetrieval page2 = new ReaderRetrieval(); page2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); page2.setTitle("Reader Retrieval"); page2.setLocation(200, 100); page2.setSize(615, 600); page2.setVisible(true ); } if (e.getSource() == list) { this.dispose(); BorrowList page2 = new BorrowList(); page2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); page2.setTitle("Borrow List"); page2.setLocation(200, 100); page2.setSize(495, 515); page2.setVisible(true ); } } }

LogIn.java import java.awt.BorderLayout; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.*; importjavax.management.openmbean.OpenDataException; import javax.swing.*;
-46-

课程名称:数据库系统概论

importjava.awt.Font; publicclass LogIn { publicstaticvoid main(String[] args) { My f = new My(); f.setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE ); f.setTitle("Log In"); f.setLocation(300, 200); f.setSize(300, 150); f.setVisible(true); } } classMyextends JFrame implements ActionListener { SQLOperation op = new SQLOperation(); Container c = getContentPane(); JPanel p1 = new JPanel(); JPanel p2 = new JPanel(); JLabel userName = new JLabel(" User name:"); JLabel password = new JLabel(" Password:"); JTextField nameField = new JTextField(); JPasswordField passField = new JPasswordField(); JButton confirm = new JButton("Confirm!"); public My() { c.add(p1, BorderLayout.CENTER); c.add(p2, BorderLayout.SOUTH); p1.setLayout(new GridLayout(2, 2, 50, 10)); p1.add(userName); p1.add(nameField); p1.add(password); p1.add(passField); p2.add(confirm); confirm.addActionListener(this); } @Override publicvoid actionPerformed(ActionEvent e) {
-47-

课程名称:数据库系统概论

if (e.getSource() == confirm) { String name = nameField.getText(); String pass = passField.getText(); inti = op.logCheck(name, pass); if (i == 1) { this.dispose(); MyFrame f = new MyFrame(); f.setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE ); f.setTitle("Library Management System"); f.setLocation(300, 200); f.setSize(580, 300); f.setVisible(true); } else { JOptionPane.showMessageDialog (null, "Please enter a validated username and password!", "Warning", JOptionPane.INFORMATION_MESSAGE ); } } // TODO Auto-generated method stub } }

ReaderDetails.java import java.awt.BorderLayout; import java.awt.Container; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.event.*; import java.util.ArrayList;
-48-

课程名称:数据库系统概论

import javax.swing.*; import javax.swing.table.DefaultTableModel; publicclassReaderDetailsextends JFrame implements ActionListener { SQLOperation op = new SQLOperation(); Container c = getContentPane(); JPanel p1 = new JPanel(); JPanel p2 = new JPanel(); JPanel p3 = new JPanel(); JLabel readerNumber = new JLabel("Reader Number:"); JLabel readerName = new JLabel("Reader Name:"); JLabel sex = new JLabel("Sex:"); JLabel dpt = new JLabel("Department:"); JLabel grade = new JLabel("Grade:"); JLabel numberField = new JLabel(); JLabel nameField = new JLabel(); JLabel sexField = new JLabel(); JLabel dptField = new JLabel(); JLabel gradeField = new JLabel(); JButton cancel = new JButton("Cancel"); JLabel details = new JLabel("Borrow and reaturn details"); Object[] s = { "Book number", "Borrow time", "Deadline", "Over time" }; Object[][] ob1 = new Object[7][4]; JTable table = new JTable(ob1, s); JScrollPane scrollPane = new JScrollPane(table); public ReaderDetails(String number) { ReaderInfo reader = new ReaderInfo(number); ob1 = op.borrowListForReader(number); for (inti = 0; i< 5; i++) { DefaultTableModel books = new DefaultTableModel(ob1, s); for (intn = 0; n< 7; n++) { for (intm = 0; m< 4; m++) { ob1[n][m] = this.ob1[n][m];
-49-

课程名称:数据库系统概论

} table.setModel(books); table.invalidate(); } } ArrayList<String>strArray = new ArrayList<String>(); strArray = op.outputReader(reader); numberField.setText(number); nameField.setText(strArray.get(1)); sexField.setText(strArray.get(2)); dptField.setText(strArray.get(3)); gradeField.setText(strArray.get(4)); c.add(p1, BorderLayout.NORTH); c.add(p2, BorderLayout.CENTER); c.add(p3, BorderLayout.SOUTH); p1.setLayout(new GridLayout(6, 2, 20, 10)); p1.add(readerNumber); p1.add(numberField); p1.add(readerName); p1.add(nameField); p1.add(sex); p1.add(sexField); p1.add(dpt); p1.add(dptField); p1.add(grade); p1.add(gradeField); p1.add(details); scrollPane.setBounds(0, 0, 800, 300); p2.add(scrollPane); p3.add(cancel); table.setPreferredScrollableViewportSize( new Dimension(400, 200)); cancel.addActionListener( this); } publicvoid actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if (e.getSource() == cancel) {
-50-

课程名称:数据库系统概论

this.dispose(); } } }

ReaderInfo.java publicclass ReaderInfo { private String number, name, sex, dpt; privateintgrade; // default constructor public ReaderInfo() { } public ReaderInfo(String number) { this.number = number; } public ReaderInfo(String number, String name) { this.number = number; this.name = name; } public ReaderInfo(String number, String name, String sex, String dpt, intgrade) { this.number = number; this.name = name; this.sex = sex; this.dpt = dpt; this.grade = grade; } public String getNumber() {
-51-

课程名称:数据库系统概论

returnnumber; } public String getName() { returnname; } public String getSex() { returnsex; } public String getDpt() { returndpt; } publicint getGrade() { returngrade; } }

ReaderRetrieval.java import java.awt.BorderLayout; import java.awt.Container; import java.awt.Font; import java.awt.GridLayout; import java.awt.event.*; import java.util.ArrayList; importjava.util.Collections; import javax.swing.*; import javax.swing.table.DefaultTableModel; classReaderRetrievalextends JFrame implements ActionListener { SQLOperation op = new SQLOperation(); Container c = getContentPane(); JPanel p1 = new JPanel();
-52-

课程名称:数据库系统概论

JPanel p4 = new JPanel(); JPanel p5 = new JPanel(); JLabel readerNumber = new JLabel("Reader Number:"); JLabel readerName = new JLabel("Reader Name:"); JTextField number = new JTextField(); JTextField name = new JTextField(); JButton back = new JButton("Back (Fresh)"); JButton addReader = new JButton("Add a reader"); JButton deleteReader = new JButton("Delete a reader"); JButton editReader = new JButton("Edit a reader"); JButton search = new JButton("Search for details!"); Object[] s = { "Number", "Name", "Sex", "Department", "Grade" }; Object[][] ob = new Object[20][5]; JTable table = new JTable(ob, s); JScrollPane scrollPane = new JScrollPane(table); Font font1 = new Font("00", Font.BOLD, 20); public ReaderRetrieval() { ReaderInfo reader = new ReaderInfo(); op.allReader(reader); ob = op.allReader(reader); for (inti = 0; i< 5; i++) { DefaultTableModel readers = new DefaultTableModel(ob, s); for (intn = 0; n< 20; n++) { for (intm = 0; m< 5; m++) { ob[n][m] = this.ob[n][m]; } table.setModel(readers); table.invalidate(); } } search.setFont(font1); c.add(p4, BorderLayout.NORTH); c.add(p1, BorderLayout.CENTER); c.add(p5, BorderLayout.SOUTH); p4.setLayout(new GridLayout(2, 4, 20, 10)); p4.add(back); p4.add(addReader);
-53-

课程名称:数据库系统概论

p4.add(editReader); p4.add(deleteReader); p1.setLayout(null); scrollPane.setBounds(0, 0, 600, 300); p1.add(scrollPane); p5.setLayout(new GridLayout(5, 1, 0, 0)); p5.add(readerNumber); p5.add(number); p5.add(readerName); p5.add(name); p5.add(search); addReader.addActionListener(this); search.addActionListener( this); back.addActionListener(this); deleteReader.addActionListener( this); editReader.addActionListener(this); } publicvoid actionPerformed(ActionEvent e) { if (e.getSource() == search) { ArrayList<String>strArray = new ArrayList<String>(); strArray = op.addReaderJudgement(); String s1 = number.getText(); String s2 = name.getText(); intn = 0; intreplicate = 0; while (n< Integer.parseInt (strArray.get(0))) { n++; if (s1.equals(strArray.get(n))) { replicate++; } } ArrayList<String>strArray1 = new ArrayList<String>(); strArray1 = op.addReaderJudgement1(); intn1 = 0; intreplicate1 = 0; while (n1< Integer.parseInt(strArray1.get(0))) { n1++;
-54-

课程名称:数据库系统概论

if (s2.equals(strArray1.get(n1))) { replicate1++; } } if (replicate == 0 &&replicate1 == 0) { JOptionPane.showMessageDialog (null, "Please input a correct reader number or name!", "Warning", JOptionPane.INFORMATION_MESSAGE ); } elseif (replicate != 0 || replicate1 != 0) { if (replicate == 0 &&replicate1 != 0) { ReaderInfo reader = new ReaderInfo(s1, s2); String s = op.searchReaderByName(reader); ReaderDetails f = new ReaderDetails(s); //f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Reader Details"); f.setLocation(300, 200); f.setSize(480, 470); f.setVisible(true); } elseif (replicate != 0) { ReaderDetails f = new ReaderDetails(s1); //f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Reader Details"); f.setLocation(300, 200); f.setSize(480, 470); f.setVisible(true); } } } if (e.getSource() == back) { this.dispose(); MyFrame f = new MyFrame();
-55-

课程名称:数据库系统概论

//f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Library Management System"); f.setLocation(300, 200); f.setSize(580, 300); f.setVisible(true); } if (e.getSource() == addReader) { AddReader f = new AddReader(); //f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Add a Reader"); f.setLocation(300, 200); f.setSize(300, 300); f.setVisible(true); } if (e.getSource() == deleteReader) { DeleteReader f = new DeleteReader(); //f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Delete a reader"); f.setLocation(300, 200); f.setSize(300, 200); f.setVisible(true); } if (e.getSource() == editReader) { SelectEditReader f = new SelectEditReader(); //f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Edit a reader"); f.setLocation(300, 200); f.setSize(300, 200); f.setVisible(true); } } }

ReturnBook.java
-56-

课程名称:数据库系统概论

import import import import import

java.awt.BorderLayout; java.awt.Container; java.awt.GridLayout; java.awt.event.*; java.util.ArrayList;

importjavax.management.openmbean.OpenDataException; import javax.swing.*; publicclassReturnBookextends JFrame implements ActionListener { SQLOperation op = new SQLOperation(); Container c = getContentPane(); JPanel p1 = new JPanel(); JLabel bookNumber = new JLabel("Book Number:"); JTextField numberField = new JTextField(); JLabel readerNumber = new JLabel("Reader Number:"); JTextField readerNumberField = new JTextField(); JButtoncancel = newJButton("Cancel"); JButtonreturnBook = newJButton("Return!!"); public ReturnBook() { c.add(p1, BorderLayout.NORTH); p1.setLayout(new GridLayout(3, 2, 20, 10)); p1.add(bookNumber); p1.add(numberField); p1.add(readerNumber); p1.add(readerNumberField); p1.add(cancel); p1.add(returnBook); cancel.addActionListener( this); returnBook.addActionListener(this); } publicvoid actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if (e.getSource() == cancel) { this.dispose(); } if (e.getSource() == returnBook) {
-57-

课程名称:数据库系统概论

String bookNumber = numberField.getText(); ArrayList<String>strArray = new ArrayList<String>(); strArray = op.addBookJudgement(); intn = 0; intreplicate = 0; while (n< Integer.parseInt (strArray.get(0))) { n++; if (bookNumber.equals(strArray.get(n))) { replicate++; } } String readerNumber = readerNumberField.getText(); ArrayList<String>strArray1 = new ArrayList<String>(); strArray1 = op.addReaderJudgement(); intn1 = 0; intreplicate1 = 0; while (n1< Integer.parseInt(strArray1.get(0))) { n1++; if (readerNumber.equals(strArray1.get(n1))) { replicate1++; } } if (replicate == 0 || replicate1 == 0) { JOptionPane .showMessageDialog( null, "Please input a correct book number and a reader number!", "Warning", JOptionPane.INFORMATION_MESSAGE ); } else { if (op.returnCheck(numberField.getText(), readerNumberField.getText()) == 1) { JOptionPane.showMessageDialog (null, "No result found!", "Warning",
-58-

课程名称:数据库系统概论

JOptionPane.INFORMATION_MESSAGE ); } else { BookInfo book = new BookInfo(bookNumber); ArrayList<String>s = new ArrayList<String>(); s = op.outputBook(book); BookInfo book1 = new BookInfo(s.get(0), s.get(1), s.get(2), s.get(3), s.get(4), s.get(5), Integer.parseInt(s.get(6)), Integer.parseInt(s.get(7)) + 1); op.inputBook(book1); if(op.deleteResult(numberField.getText(), readerNumberField.getText())==1){ JOptionPane.showMessageDialog (null, "Return the book successful!", "Successful", JOptionPane.INFORMATION_MESSAGE ); this.dispose(); }else{ JOptionPane.showMessageDialog (null, "Failed to return the book!", "Unsuccessful", JOptionPane.INFORMATION_MESSAGE ); } } } } } }

SelectEdit.java
-59-

课程名称:数据库系统概论

import import import import

java.awt.BorderLayout; java.awt.Container; java.awt.GridLayout; java.awt.event.*;

import javax.swing.*; publicclassSelectEditextends JFrame implements ActionListener { SQLOperation op = new SQLOperation(); BookInfo book = new BookInfo(); Container c = getContentPane(); JPanel p1 = new JPanel(); JLabel bookNumber = new JLabel("Book Number:"); JTextField numberField = new JTextField(); JButton cancel = new JButton("Cancel"); JButton select = new JButton("Select!!"); public SelectEdit() { c.add(p1, BorderLayout.NORTH); p1.setLayout(new GridLayout(2, 2, 20, 10)); p1.add(bookNumber); p1.add(numberField); p1.add(cancel); p1.add(select); cancel.addActionListener( this); select.addActionListener( this); } publicvoid actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if (e.getSource() == cancel) { this.dispose(); } if (e.getSource() == select) { this.dispose(); try { EditBook f = new EditBook(numberField.getText());
-60-

课程名称:数据库系统概论

//f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Edit a book"); f.setLocation(300, 200); f.setSize(300, 400); f.setVisible(true); } catch (Exception e2) { JOptionPane.showMessageDialog (null, "Please input the book number correctly!", "Warning", JOptionPane.INFORMATION_MESSAGE ); // TODO: handle exception } } } }

SelectEditReader.java import java.awt.BorderLayout; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.*; import javax.swing.*; publicclassSelectEditReaderextends JFrame implements ActionListener { Container c = getContentPane(); JPanel p1 = new JPanel(); JLabel readerNumber = new JLabel("Reader Number:"); JTextField numberField = new JTextField(); JButton cancel = new JButton("Cancel"); JButton select = new JButton("Select!!");

-61-

课程名称:数据库系统概论

public SelectEditReader() { c.add(p1, BorderLayout.NORTH); p1.setLayout(new GridLayout(2, 2, 20, 10)); p1.add(readerNumber); p1.add(numberField); p1.add(cancel); p1.add(select); cancel.addActionListener( this); select.addActionListener( this); } publicvoid actionPerformed(ActionEvent e) { // TODO Auto-generated method stub if (e.getSource() == cancel) { this.dispose(); } if (e.getSource() == select) { this.dispose(); try { EditReader f = new EditReader(numberField.getText()); //f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setTitle("Edit a reader"); f.setLocation(300, 200); f.setSize(300, 300); f.setVisible(true); } catch (Exception e2) { JOptionPane.showMessageDialog (null, "Please input the reader number correctly!", "Warning", JOptionPane.INFORMATION_MESSAGE ); // TODO: handle exception } } } }
-62-

课程名称:数据库系统概论

SQLOperation.java import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; publicclass SQLOperation { static PreparedStatement ps = null; static Connection ct = null; static ResultSet rs = null; public SQLOperation() { try { Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDri ver"); ct = DriverManager.getConnection( "jdbc:sqlserver://127.0.0.1:1433;DatabaseName=Library", "sa", "123456"); } catch (Exception e) { e.printStackTrace(); // TODO: handle exception } } publicint logCheck(String name, String password) { inti = 0; try { ArrayList<String>strArray = new ArrayList<String>(); String sql = "select * FROM 管理员 "; PreparedStatement ps = ct.prepareStatement(sql); // ps.setString(1, book.getNumber()); rs = ps.executeQuery(); intcount = 0;
-63-

课程名称:数据库系统概论

while (rs.next()) { String s = rs.getString("登录名 "); strArray.add(s); s = rs.getString("密码 "); strArray.add(s); } if (strArray.get(0).equals(name) &&strArray.get(1).equals(password)) { i = 1; } } catch (Exception e) { System.out.println(e); } System.out.print(i); returni; } publicArrayList addBookJudgement1() { ArrayList<String>strArray = new ArrayList<String>(); ArrayList<String>strArray1 = new ArrayList<String>(); try { String sql = "select 书名 FROM 图书信息 "; PreparedStatement ps = ct.prepareStatement(sql); // ps.setString(1, book.getNumber()); rs = ps.executeQuery(); intcount = 0; while (rs.next()) { String s = rs.getString("书名 "); strArray.add(s); count++; } strArray.add(Integer.toString(count)); for (; count>= 0; count--) { strArray1.add(strArray.get(count)); } } catch (Exception e) { System.out.println(e); } returnstrArray1;
-64-

课程名称:数据库系统概论

} publicArrayList addReaderJudgement1() { ArrayList<String>strArray = new ArrayList<String>(); ArrayList<String>strArray1 = new ArrayList<String>(); try { String sql = "select 姓名 FROM 读者信息 "; PreparedStatement ps = ct.prepareStatement(sql); // ps.setString(1, book.getNumber()); rs = ps.executeQuery(); intcount = 0; while (rs.next()) { String s = rs.getString("姓名 "); strArray.add(s); count++; } strArray.add(Integer.toString(count)); for (; count>= 0; count--) { strArray1.add(strArray.get(count)); } } catch (Exception e) { System.out.println(e); } returnstrArray1; } publicArrayList addBookJudgement() { ArrayList<String>strArray = new ArrayList<String>(); ArrayList<String>strArray1 = new ArrayList<String>(); try { String sql = "select 编号 FROM 图书信息 "; PreparedStatement ps = ct.prepareStatement(sql); // ps.setString(1, book.getNumber()); rs = ps.executeQuery(); intcount = 0; while (rs.next()) { String s = rs.getString("编号 "); strArray.add(s); count++; } strArray.add(Integer.toString(count));
-65-

课程名称:数据库系统概论

for (; count>= 0; count--) { strArray1.add(strArray.get(count)); } } catch (Exception e) { System.out.println(e); } returnstrArray1; } publicArrayList addReaderJudgement() { ArrayList<String>strArray = new ArrayList<String>(); ArrayList<String>strArray1 = new ArrayList<String>(); try { String sql = "select 编号 FROM 读者信息 "; PreparedStatement ps = ct.prepareStatement(sql); rs = ps.executeQuery(); intcount = 0; while (rs.next()) { String s = rs.getString("编号 "); strArray.add(s); count++; } strArray.add(Integer.toString(count)); for (; count>= 0; count--) { strArray1.add(strArray.get(count)); } } catch (Exception e) { System.out.println(e); } returnstrArray1; } publicvoid saveReader(ReaderInfo reader) { try { String sql = "INSERT INTO 读者信息 (编号 ,姓名 , 性别 ,系 名 ,年级 ) VALUES (?,?,?,?,?);"; PreparedStatement pts = ct.prepareStatement(sql); pts.setString(1, reader.getNumber()); pts.setString(2, reader.getName()); pts.setString(3, reader.getSex()); pts.setString(4, reader.getDpt());
-66-

课程名称:数据库系统概论

pts.setInt(5, reader.getGrade()); pts.executeUpdate(); } catch (Exception e) { System.out.println(e); } } publicvoid saveBook(BookInfo book) { try { String sql = "INSERT INTO 图书信息 (编号 ,书名 , 作者 ,出 版社 , 出版日期 , 摘要 , 总量 , 现存量 ) VALUES (?,?,?,?,?,?,?,?);"; PreparedStatement pts = ct.prepareStatement(sql); pts.setString(1, book.getNumber()); pts.setString(2, book.getName()); pts.setString(3, book.getAuthor()); pts.setString(4, book.getPress()); pts.setString(5, book.getPressTime()); pts.setString(6, book.getBookAbstract()); pts.setInt(7, book.getTotal()); pts.setInt(8, book.getRemain()); pts.executeUpdate(); } catch (Exception e) { System.out.print(e); } } public String searchBookByName(BookInfo book) { String s = null; try { String sql = "select 编号 FROM 图书信息 where 书名 =?;"; PreparedStatement ps = ct.prepareStatement(sql); ps.setString(1, book.getName()); rs = ps.executeQuery(); while (rs.next()) { s = rs.getString("编号 "); } } catch (Exception e) { System.out.println(e); }
-67-

课程名称:数据库系统概论

returns; } public String searchReaderByName(ReaderInfo reader) { String s = null; try { String sql = "select 编号 FROM 读者信息 where 姓名 =?;"; PreparedStatement pts = ct.prepareStatement(sql); pts.setString(1, reader.getName()); rs = pts.executeQuery(); while (rs.next()) { s = rs.getString("编号 "); } } catch (Exception e) { System.out.println(e); } returns; } publicint deleteBook(BookInfo book) { try { String sql = "delete FROM 图书信息 where 编号 =?;"; PreparedStatement pts = ct.prepareStatement(sql); pts.setString(1, book.getNumber()); intcount = pts.executeUpdate(); if (count == 1) { return 1; } else { return 0; } } catch (Exception e) { System.out.println(e); return 0; } } publicint deleteReader(ReaderInfo reader) { try { String sql = "delete FROM 读者信息 where 编号 =?;";
-68-

课程名称:数据库系统概论

PreparedStatement pts = ct.prepareStatement(sql); pts.setString(1, reader.getNumber()); intcount = pts.executeUpdate(); if (count == 1) { return 1; } else { return 0; } } catch (Exception e) { System.out.println(e); return 0; } } publicArrayList outputBook(BookInfo book) { ArrayList<String>strArray = new ArrayList<String>(); try { String sql = "select * FROM 图书信息 where 编号 =?;"; PreparedStatement ps = ct.prepareStatement(sql); ps.setString(1, book.getNumber()); rs = ps.executeQuery(); while (rs.next()) { String s = rs.getString("编号 "); strArray.add(s); s = rs.getString("书名 "); strArray.add(s); s = rs.getString("作者 "); strArray.add(s); s = rs.getString("出版社 "); strArray.add(s); s = rs.getString("出版日期 "); strArray.add(s); s = rs.getString("摘要 "); strArray.add(s); s = rs.getString("总量 "); strArray.add(s); s = rs.getString("现存量 "); strArray.add(s); } } catch (Exception e) { System.out.println(e);
-69-

课程名称:数据库系统概论

} returnstrArray; } publicArrayList outputReader(ReaderInfo reader) { ArrayList<String>strArray = new ArrayList<String>(); try { String sql = "select * FROM 读者信息 where 编号 =?;"; PreparedStatement ps = ct.prepareStatement(sql); ps.setString(1, reader.getNumber()); rs = ps.executeQuery(); while (rs.next()) { String s = rs.getString("编号 "); strArray.add(s); s = rs.getString("姓名 "); strArray.add(s); s = rs.getString("性别 "); strArray.add(s); s = rs.getString("系名 "); strArray.add(s); s = rs.getString("年级 "); strArray.add(s); } } catch (Exception e) { System.out.println(e); } returnstrArray; } publicvoid inputBook(BookInfo book) { ArrayList<String>strArray = new ArrayList<String>(); try { String sql = "update 图书信息 set 书名 =?, 作者 =?, 出版 社 =?,出版日期 =?, 摘要 =?,总量 =?, 现存量 =? where 编号 =?;"; PreparedStatement pts = ct.prepareStatement(sql); pts.setString(1, book.getName()); pts.setString(2, book.getAuthor()); pts.setString(3, book.getPress()); pts.setString(4, book.getPressTime()); pts.setString(5, book.getBookAbstract()); pts.setInt(6, book.getTotal());
-70-

课程名称:数据库系统概论

pts.setInt(7, book.getRemain()); pts.setString(8, book.getNumber()); pts.executeUpdate(); } catch (Exception e) { System.out.println(e); } } publicvoid inputReader(ReaderInfo reader) { try { String sql = "update 读者信息 set 姓名 =?, 性别 =?, 系名 =?,年级 =? where 编号 =?;"; PreparedStatement pts = ct.prepareStatement(sql); pts.setString(1, reader.getName()); pts.setString(2, reader.getSex()); pts.setString(3, reader.getDpt()); pts.setInt(4, reader.getGrade()); pts.setString(5, reader.getNumber()); pts.executeUpdate(); } catch (Exception e) { System.out.println(e); } } public Object[][] allBook(BookInfo book) { Object[][] ob = new Object[60][8]; intn = 0; try { String sql = "select * FROM 图书信息 "; PreparedStatement ps = ct.prepareStatement(sql); rs = ps.executeQuery(); while (rs.next()) { ob[n][0] = rs.getString("编号 "); ob[n][1] = rs.getString("书名 "); ob[n][2] = rs.getString("作者 "); ob[n][3] = rs.getString("出版社 "); ob[n][4] = rs.getString("出版日期 "); ob[n][5] = rs.getString("摘要 "); ob[n][6] = rs.getString("总量 "); ob[n][7] = rs.getString("现存量 "); n++;
-71-

课程名称:数据库系统概论

} } catch (Exception e) { System.out.println(e); } returnob; } public Object[][] allReader(ReaderInfo reader) { Object[][] ob = new Object[60][5]; intn = 0; try { String sql = "select * FROM 读者信息 "; PreparedStatement ps = ct.prepareStatement(sql); rs = ps.executeQuery(); while (rs.next()) { ob[n][0] = rs.getString("编号 "); ob[n][1] = rs.getString("姓名 "); ob[n][2] = rs.getString("性别 "); ob[n][3] = rs.getString("系名 "); ob[n][4] = rs.getString("年级 "); n++; } } catch (Exception e) { System.out.println(e); } returnob; } publicvoid insertBorrow(String bookNumber, String readerNumber, String borrowTime, String deadline) { try { String sql = "Insert into 图书借阅 ( 图书编号 , 读者 编号 , 借阅时间 , 应还时间 ) values(?,?,?,?)"; PreparedStatement pts = ct.prepareStatement(sql); pts.setString(1, bookNumber); pts.setString(2, readerNumber); pts.setString(3, borrowTime); pts.setString(4, deadline); pts.executeUpdate(); } catch (Exception e) {
-72-

课程名称:数据库系统概论

System.out.println(e); } } publicint reBorrowCheck(String bookNumber, String readerNumber) { inti = 0; ArrayList<String>strArray = new ArrayList<String>(); try { String sql = "select * FROM 图书借阅 where 图书编 号 =? and 读者编号 =?"; PreparedStatement ps = ct.prepareStatement(sql); ps.setString(1, bookNumber); ps.setString(2, readerNumber); rs = ps.executeQuery(); intcount = 0; while (rs.next()) { String s = rs.getString("图书编号 "); strArray.add(s); s = rs.getString("读者编号 "); strArray.add(s); count++; } System.out.println(strArray); if (count>= 1) { i = 1; } } catch (Exception e) { System.out.println(e); } returni; } publicint deadLineCheck(String readerNumber, longcurrentTime) { inti = 0; ArrayList<String>strArray = new ArrayList<String>(); try { String sql = "select * FROM 图书借阅 where 读者编
-73-

课程名称:数据库系统概论

号 =?"; PreparedStatement ps = ct.prepareStatement(sql); ps.setString(1, readerNumber); rs = ps.executeQuery(); intcount = 0; while (rs.next()) { String s = rs.getString("应还时间 "); strArray.add(s); count++; } for (; count> 0; count--) { if (Long.parseLong(strArray.get(count - 1)) <= currentTime) { i++; } } } catch (Exception e) { System.out.println(e); } returni; } publicint returnCheck(String bookNumber, String readerNumber) { inti = 0; ArrayList<String>strArray = new ArrayList<String>(); try { String sql = "select * FROM 图书借阅 where 图书编 号 =? and 读者编号 =?"; PreparedStatement ps = ct.prepareStatement(sql); ps.setString(1, bookNumber); ps.setString(2, readerNumber); rs = ps.executeQuery(); while (rs.next()) { String s = rs.getString("图书编号 "); strArray.add(s); s = rs.getString("读者编号 "); strArray.add(s); } System.out.println(strArray); if (strArray.get(0) != bookNumber
-74-

课程名称:数据库系统概论

|| strArray.get(1) != readerNumber) { i = 0; } } catch (Exception e) { System.out.println(e); i = 1; } System.out.print(i); returni; } publicint deleteResult(String bookNumber, String readerNumber) { try { String sql = "delete FROM 图书借阅 where 图书编号 =? and 读者编号 =?;"; PreparedStatement pts = ct.prepareStatement(sql); pts.setString(1, bookNumber); pts.setString(2, readerNumber); intcount = pts.executeUpdate(); if (count == 1) { return 1; } else { return 0; } } catch (Exception e) { System.out.println(e); return 0; } } public Object[][] borrowList() { Date dateCal = new Date(); Object[][] ob = new Object[100][5]; intn = 0; try { String sql = "select * FROM 图书借阅 "; PreparedStatement ps = ct.prepareStatement(sql); rs = ps.executeQuery(); while (rs.next()) {
-75-

课程名称:数据库系统概论

ob[n][0] = rs.getString("图书编号 "); ob[n][1] = rs.getString("读者编号 "); String s = dateCal.borrowTimeInterface(Long.parseLong (rs .getString("借阅时间 "))); ob[n][2] = s; longre = Long.parseLong (rs.getString("应还时间 ")); s = dateCal.borrowTimeInterface (re); ob[n][3] = s; longre1 = System.currentTimeMillis (); if (re1>re) { ob[n][4] = Long.toString (((re1 - re) / 86400000)+1) + " Days"; } else { ob[n][4] = "NOT"; } n++; } } catch (Exception e) { System.out.println(e); } returnob; } public Object[][] borrowListForReader(String readerNumber) { Date dateCal = new Date(); Object[][] ob = new Object[100][4]; intn = 0; try { String sql = "select * FROM 图书借阅 where 读者编号 =?"; PreparedStatement ps = ct.prepareStatement(sql); ps.setString(1, readerNumber); rs = ps.executeQuery(); while (rs.next()) { ob[n][0] = rs.getString("图书编号 "); String s = dateCal.borrowTimeInterface(Long.parseLong (rs .getString("借阅时间 ")));
-76-

课程名称:数据库系统概论

ob[n][1] = s; longre = Long.parseLong (rs.getString("应还时间 ")); s = dateCal.borrowTimeInterface (re); ob[n][2] = s; longre1 = System.currentTimeMillis (); if (re1>re) { ob[n][3] = Long.toString (((re1 - re) / 86400000)+1) + " Days"; } else { ob[n][3] = "NOT"; } n++; } } catch (Exception e) { System.out.println(e); } returnob; } public Object[][] borrowListForBook(String bookNumber) { Date dateCal = new Date(); Object[][] ob = new Object[100][8]; intn = 0; try { String sql = "select * FROM 图书借阅 where 图书编号 =?"; PreparedStatement ps = ct.prepareStatement(sql); ps.setString(1, bookNumber); rs = ps.executeQuery(); while (rs.next()) { ob[n][0] = rs.getString("读者编号 "); String s = dateCal.borrowTimeInterface(Long.parseLong (rs .getString("借阅时间 "))); ob[n][1] = s; longre = Long.parseLong (rs.getString("应还时间 ")); s = dateCal.borrowTimeInterface (re); ob[n][2] = s; longre1 = System.currentTimeMillis ();
-77-

课程名称:数据库系统概论

if (re1>re) { ob[n][3] = Long.toString (((re1 - re) / 86400000)+1) + " Days"; } else { ob[n][3] = "NOT"; } n++; } } catch (Exception e) { System.out.println(e); } returnob; } publicint deleteBookCheck(String bookNumber) { inti = 0; ArrayList<String>strArray = new ArrayList<String>(); try { String sql = "select * FROM 图书借阅 "; PreparedStatement ps = ct.prepareStatement(sql); // ps.setString(1, bookNumber); rs = ps.executeQuery(); intcount = 0; while (rs.next()) { String s = rs.getString("图书编号 "); strArray.add(s); count++; } for (; count> 0; count--) { if (strArray.get(count - 1).equals(bookNumber)) { i++; } } } catch (Exception e) { System.out.println(e); } returni; } publicint deleteReaderCheck(String readerNumber) {
-78-

课程名称:数据库系统概论

inti = 0; ArrayList<String>strArray = new ArrayList<String>(); try { String sql = "select * FROM 图书借阅 "; PreparedStatement ps = ct.prepareStatement(sql); // ps.setString(1, bookNumber); rs = ps.executeQuery(); intcount = 0; while (rs.next()) { String s = rs.getString("读者编号 "); strArray.add(s); count++; } for (; count> 0; count--) { if (strArray.get(count 1).equals(readerNumber)) { i++; } } } catch (Exception e) { System.out.println(e); } returni; } }

十、总结
经过这段时间的努力基本完成了图书管理系统。同时通过这几天的程 序及报告编写,把学过的 Java 知识运用到了实践。我也发现了自己 的很多不足,自己知识的很多漏洞,看到了自己的实践经验还是比较
-79-

课程名称:数据库系统概论

缺乏,理论联系实际的能力还是比较脆弱。尤其是编写大型的程序所 要拥有的知识和技能比较缺乏。程序编好了,还要经过调试和修改, 这步也很关键,好的程序是经过了无数次的修改和调试才产生的。我 们的程序基本上能够满足要求,但还有一些地方需要改进,在今后我 们应该在多看书的同时还要加强实践的练习。才能进一步提高自己的 编程能力。

参考文献
[1]王珊 , 萨师煊 . 《数据库系统概论》 .高等教育出版社 ,2006.5 [2]Y.Danniel Liang.《 Java 语言程序设计 -基础篇》. 机械工业出版社,2011.5 [3]张峋,杨三成 .《 JSP 与 JDBC 应用详解》 . 中国铁道出版社, 2010.11

-80-


相关文章:
图书管理系统java代码
图书管理系统java代码_计算机软件及应用_IT/计算机_...后者又扩展 Container //每个 JPanel 是一个 ...
Java-图书馆管理系统(附全代码)-课程设计报告
Java-图书馆管理系统(附全代码)-课程设计报告_工学_高等教育_教育专区 暂无评价|0人阅读|0次下载Java-图书馆管理系统(附全代码)-课程设计报告_工学_高等教育_...
图书管理系统需求分析报告附有java代码
图书管理系统需求分析报告附有java代码_计算机软件及应用_IT/计算机_专业资料。...的 管理,现今,有很多的图书馆是初步开始使用,甚至尚未使用计算机进行信息管理...
java编写的图书管理系统源代码
java编写的图书管理系统源代码_计算机软件及应用_IT/计算机_专业资料。/用户登陆数据库代码: importjava.sql.*; classDatabase{ Connectioncon; ResultSetrs; ...
图书管理系统---java代码
图书管理系统---java代码_计算机软件及应用_IT/计算机_专业资料。import java.awt.*; import java.awt.event.*; import java.sql.*; import java.util.*; ...
基于java的图书管理系统源代码
声明:本系统是基于 C/S 的图书管理 系统,主要使用的是 Oracle 数据库, 下面附所有实现代码 package library; import java.awt.BorderLayout; import java.awt....
图书管理系统需求分析报告附有java代码
图书管理系统需求分析报告附有java代码_计算机软件及应用_IT/计算机_专业资料。用...的管理,现今,有很多的图书馆是初步开始使 用,甚至尚未使用计算机进行信息管理...
JAVA图书馆管理系统
java课程设计小型图书管理... 34页 免费 java图书管理系统代码 3页 免费 java...仓库的管理的操作自动化和信息的电子化,全 面提高了仓库的管理水平。 随着我国...
JAVA图书馆管理系统
JAVA图书馆管理系统_计算机软件及应用_IT/计算机_专业资料。1 系统开发环境 1....以至于要制作一个简单的动态页面都需要编写大量的代码才能 完成,而 ASP 却允许使用...
图书管理系统 Java代码 功能搜索与添加
图书管理系统 Java代码 功能搜索与添加_计算机软件及应用_IT/计算机_专业资料。Startwindow.java /** * @author Caroline * @version 1.0 * * 此类用于创建...
更多相关标签: