Library Management System
Library Management System
Table of contents
Page No.
1 Introduction
1.1 Problem Definition 1.2 Objective & Scope 1.3 Proposed System 1.4 Assumptions & Constraints 1.5 System Requirements 3 3 5 6 7
Software Requirement Specification[SRS] & Design 2.1 Introduction Purpose System overview 2.2 Overall description Product perspective Product functions User characteristics Constraints, assumptions and dependencies 10 10 10 11 8 8
Specific requirements 3.1 Interface requirements 3.2 Functional requirements 3.3 Performance requirements 3.4 Design constraints 3.5 Database Schema 3.6 Software System attributes 3.7 Detailed Life Cycle of the project 12 12 13 13 14 16 16
Page 1
Project Implementation 4.1 Work Break down Structure 4.2 Gantt Chart 4.3 Pert Chart 4.4 Code with reference to design 4.5 Snapshot of UI & Reports 19 20 22 23 96
Future Enhancements
102
Limitations
103
Conclusion
104
Bibliographies
105
Page 2
CHAPTER 1 INTRODUCTION
1.1 Problem Definition
TO DEVELOP A LIBRARY MANAGEMENT SYSTEM. Library Management System can be used by education institutes to maintain the records of books easily. Achieving this objective is difficult using manual system as the information is scattered, can be redundant and collecting relevant information may be very time consuming. All these problems are solved using this project. As there are many books present in library and also there are various books issued by librarians to the members. It is very difficult to maintain huge catalogue within reasonable space constraints manually and to maintain the same is very time and space consuming process. If we want complete information of available books or issued books at any given point of time it is difficult to get it. Although manual system can handle but there are some flaws in this system: Data Redundancy. Lot Of Paperwork Involved. Time Consuming Process.
Page 3
Scope Without a Library management System, managing and maintaining the details of the book is a tedious job for any college. Library management system will store all the details of the books including their category, availability and also maintains the details about the students to whom the books are issued. Login module: Login module will help in authentication of user accounts. Users who have valid login id and password can only login into their respective accounts Search module: Suppose there are hundreds of students and from this we have to search a particular student and we know the name of the student .In manual system it is a tedious task though we know the name of the student, but using this module we can easily search the student by specifying the name of the student in the search criteria. Thus this module will help the administrator in searching the student with various criteria easily. Addition of Books: This module helps to add the books details according to category wise. Deletion of Books: This module provides the admin option to delete the existing books from the given category and the admin can delete the already existing books from the database. Addition of Student Details: This module helps to add and maintained the details about the students to whom the books have been issued, the details of the students are categories according to their courses. Fine Module: If the student doesnt returns the books on the given due date than this module helps to imply fine on that particular student Admin id Admin password Book Details Book Issued Date Book Return Date Student id
Page 4
Existing System According to existing manual system it very tedious and time consuming work to maintain consistency of books record. There are large numbers of students who regularly take and returns books and to maintain this large data manually. It takes lot of paper work and consumes more time and place. There is also a risk of data loss because of degradation of registers, papers misplace from register etc. Apart from this there is risk of duplication of data and manipulation of data without prior authority and maintaining that record and keep them safe for long period of time is very difficult. On other hand data of particular books and students whose data is scattered in different registers and very hard for anyone to gather data of particular student or books.
Page 5
Assumptions:
This software package is developed using JAVA as front end, MS SQL as the back end which is supported by Microsoft Windows XP.
The code should be free with compilation errors or system errors. The product must have an interface which is simple enough to understand.
Constraints:
Any update regarding the availability of books, return of books, fine imposed on the students, issued date and due date are to be recorded to have updated and correct values.
Page 6
Technologies Used:
Software Requirements: Netbeans IDE 7.0 Microsoft Windows or Linux. XAMPP Server with MySQL.
Hardware Requirements: Intel Pentium IV processor or equivalent or higher 512 MB Ram or Higher 20 GB HDD or Higher Network Connectivity
Page 7
Page 8
Login
Books
Members
Search
Loan
Reserve
Add Books
Add Members
Borrow a Book
Reserve a Book
Return A Book
Edit Members
Remove Members
Edit Books
Member Info
Remove Books
STOP
Page 9
User Characteristics: Users of this system are librarian of the college who is administrator who maintains the system. The librarian should have basic knowledge of computers and internet browsing. The administrator should have some more knowledge, much about the system modules. So the admin can rectify problems caused due to catastrophic failures like hardware or power failures. Friendly graphical user interface and documents with the system will be sufficient to educate a user on how to use the system effectively, without any problems or difficulties. General users with basic computer skills can use this software. Knowledgeable User Novice User Expert User
Page 10
Constraints, Assumptions and Dependencies: The success of the system depends on: Hardware specifications of the server machine Ratio of number of user machines to server machines
Along with the system, the following third party programs will be required for the best experience: Netbeans IDE. MySQL.
Page 11
CHAPTER 3
SPECIFIC REQUIREMENTS AND PROJECT ANALYSIS AND DESIGN
3.1 Interface Requirements:
User Interface: A software provides the front-end, i.e. the user interface. Login Admin o Add Edit, Remove and Search Borrowers. o Add Edit, Remove and Search Borrowed books. o Add Edit, Remove and Search Books. o Search and Preview due dates of the Books. o Search and Preview Returned dates of the Books. o Add Edit, Remove and Search Categories. o Add and Remove Yearly Records. o Add Edit, Remove and Search Sections.
Addition of Records: Admin can add different types of books, borrowers, categories and different type of records. Deletion of Records: Admin has rights to delete different types of records like books, borrowers, categories and other records. Editing: Admin can edit the details related to books, category of books, borrowers, due date and returned date.
Page 14
Borrow
Members
Type integer integer varchar(20) varchar(20) varchar(20) varchar(20) integer integer datetime
Page 15
These are as follows: Requirement Analysis Phase Design Phase Development Phase Coding Phase Testing Phase Implementation Phase Post Implementation Phase
Page 16
REQUIREMENT ANALYSIS This phase includes the definition of the problem. In order to identify the problem: we have to know information about the problem the purpose of the evaluation for the problem to be known. To know the clients requirements and the objectives of the project, a questionnaire was prepared and the client was made to answer it. On the basis of the questionnaire, the problem is defined and evaluated. The SRS is made and requirement analysis is done.
DESIGN Software design is processes through which the requirements are translated into are presentation of software. The design of the system is in modular form i.e. the software is logically partitioned into components that perform specific functions and sub functions. The
Page 17
Design Phase leads to modules like process selection which exhibit independent functional characteristics .These modules arent interconnected. It even leads to interfaces that reduce t he complexity of the connections between modules and with that external environment.
DEVELOPMENT The development phase includes choosing of a suitable s/w to solve the particular problem given the various facilities and the sophistication in the selected software gives a better development of the problem. Here the software was built using. The data is stored in Database files for easier access.
CODING The coding phase is for retranslating the design of the system produced during the design phase into code in a given programming language which can be executed by a computer and which performs the computation specified by the design. We have used JAVA language and its basic concepts for coding the software system.
TESTING Testing is done in various ways such as testing the algorithm, programming code, sample data debugging is one. Testing has been done by checking each and every module and also to check the validations.
IMPLEMENTATION After testing is over project is implemented by providing training to the users and providing manuals so that they can be refreshed as and when needed.
POST IMPLEMENTATION If any problem occurs after the implemented they are removed from time to time so that so that the users can work on the prepared system easily finally a satisfied user when all things are almost right. Sumeet Dhende (2012450009) Jeet Dholakia (2012450010)
Page 18
Books
Add List All Available Borrowed Edit Remove
Members
Add List All Edit Remove Info
Search
Loan
Borrow Return Details
Reserve
Help
About Us
Page 19
Page 20
Page 21
Page 22
Page 23
for (int i = 0; i < informationTextField.length; i++) { informationTextFieldPanel.add(informationTextField[i] = new JTextField(25)); Sumeet Dhende (2012450009) Jeet Dholakia (2012450010) Page 26
southPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); OKButton.setFont(new Font("Tahoma", Font.BOLD, 11)); southPanel.add(OKButton); southPanel.setBorder(BorderFactory.createEtchedBorder()); cp.add("South", southPanel); insertInformationButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { //for checking if there is a missing information if (isCorrect()) { Thread runner = new Thread() { public void run() { book = new Books(); Sumeet Dhende (2012450009) Jeet Dholakia (2012450010) Page 27
/*String url = "jdbc:mysql://localhost:3306/"; String dbName = "lmsDb"; String driver = "com.mysql.jdbc.Driver"; String userName = "root"; String password = "";*/ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/jlibrary","root","pat123"); //Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //Connection con=DriverManager.getConnection("jdbc:odbc:JLibrary"); PreparedStatement ps=con.prepareStatement(sql); ps.setString(1, data[0]); ps.setString(2, data[1]); Sumeet Dhende (2012450009) Jeet Dholakia (2012450010) Page 28
"Edition,Pages,ISBN,NumberOfBooks,NumberOfAvailbleBooks,Library,Availble,ShelfNo) VALUES ('" + data[0] + "','" + data[1] + "','" + data[2] + "','" + data[3] + "', " + data[4] + ", " + data[5] + ", " + data[6] + ", '" + data[7] + "', " + data[8] + "," + data[8] + ",'" + data[9] + "', " + availble + ", '" + txtShelfNo.getText() + "')"; book.update(sql);*/ Sumeet Dhende (2012450009) Jeet Dholakia (2012450010) Page 29
Page 30
Page 31
//for creating the South Panel private JPanel southPanel = new JPanel(); //for creating a button private JButton OKButton = new JButton("Exit"); //create objects from another classes for using them in the ActionListener private Members member; //for creating an array of string to store the data private String[] data; //for checking the password public boolean isPasswordCorrect() { if (informationPasswordField[0].getText().equals(informationPasswordField[1].getText())) data[1] = informationPasswordField[1].getText();
Page 32
return true; } //for checking the information from the text field public boolean isCorrect() { data = new String[6]; for (int i = 0; i < informationLabel.length; i++) { if (i == 0) { if (!informationTextField[i].getText().equals("")) { data[i] = informationTextField[i].getText(); } else return false; } if (i == 1 || i == 2) { if (informationPasswordField[i - 1].getText().equals("")) return false; } if (i == 3 || i == 4 || i == 5 || i == 6) { if (!informationTextField[i - 2].getText().equals("")) { data[i - 1] = informationTextField[i - 2].getText(); } Sumeet Dhende (2012450009) Jeet Dholakia (2012450010)
Page 33
Page 34
Page 35
JOptionPane.showMessageDialog(null, "Member is in the Library", "Error", JOptionPane.ERROR_MESSAGE); } }; runner.start(); } //if the password is wrong else JOptionPane.showMessageDialog(null, "the passowrd is wrong", "Error", JOptionPane.ERROR_MESSAGE); } //if there is a missing data, then display Message Dialog else JOptionPane.showMessageDialog(null, "Please, complete the information", "Warning", JOptionPane.WARNING_MESSAGE); } }); //for adding the action listener for the button to dispose the frame OKButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { dispose(); } }); //for setting the visible to true Sumeet Dhende (2012450009) Jeet Dholakia (2012450010)
Page 38
public void connection() { try { Class.forName("com.mysql.jdbc.Driver"); } catch (ClassNotFoundException cnfe) { System.out.println("Borrow.java\n" + cnfe.toString()); } catch (Exception e) { System.out.println("Borrow.java\n" + e.toString()); } try { connection = DriverManager.getConnection(URL,"root","pat123"); statement = connection.createStatement(); resultSet = statement.executeQuery("SELECT * FROM Borrow"); while (resultSet.next()) { bookID = resultSet.getInt(1); Sumeet Dhende (2012450009) Jeet Dholakia (2012450010) Page 45
Page 47
Page 48
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE) .addComponent(jPasswordField1))) .addGroup(layout.createSequentialGroup() .addGap(136, 136, 136) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(84, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(115, 115, 115)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) Sumeet Dhende (2012450009) Jeet Dholakia (2012450010)
Page 49
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addGroup(layout.createSequentialGroup() .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jButton1))) .addContainerGap(81, Short.MAX_VALUE)) ); pack(); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_jTextField1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField1ActionPerformed private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_jButton1ActionPerformed if(jTextField1.getText().equals("admin") && jPasswordField1.getText().equals("admin")) { //m =new Main(this); //m.setVisible(true); EventQueue.invokeLater(new Main(new JLibrary()));
Page 50
} }//GEN-LAST:event_jButton1ActionPerformed public static void main(String args[]) { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) {
Page 51
/* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() {
new login().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JPasswordField jPasswordField1; private javax.swing.JTextField jTextField1; // End of variables declaration//GEN-END:variables } Main.java //import the packages for using the classes in them into the program import java.awt.EventQueue; import java.awt.Frame; import javax.swing.JDialog; public class Main implements Runnable { Sumeet Dhende (2012450009) Jeet Dholakia (2012450010) Page 52
Page 54
public int getMony() { return mony; } public Date getExpired() { return expired; } Sumeet Dhende (2012450009) Jeet Dholakia (2012450010) Page 55
public void update(String Query) { try { Class.forName("com.mysql.jdbc.Driver"); } catch (ClassNotFoundException cnfe) { System.out.println("Members.java\n" + cnfe.toString()); } catch (Exception e) { System.out.println("Members.java\n" + e.toString()); } try { connection = DriverManager.getConnection(URL,"root","pat123"); statement = connection.createStatement(); statement.executeUpdate(Query); statement.close(); connection.close(); Sumeet Dhende (2012450009) Jeet Dholakia (2012450010) Page 57
Page 58
Page 59
Page 60
Page 61
Page 62
Page 63
private String URL = "jdbc:mysql://localhost:3306/jlibrary"; //for creating the text area private JTextArea textArea = new JTextArea(); //for creating the vector to use it in the print private Vector lines; Sumeet Dhende (2012450009) Jeet Dholakia (2012450010)
Page 64
Page 65
Page 67
protected Vector getLines(FontMetrics fm, int wPage) { Vector v = new Vector(); String text = textArea.getText(); String prevToken = ""; StringTokenizer st = new StringTokenizer(text, "\n\r", true); while (st.hasMoreTokens()) { String line = st.nextToken(); if (line.equals("\r")) continue; // StringTokenizer will ignore empty lines, so it's a bit tricky to get them... if (line.equals("\n") && prevToken.equals("\n")) v.add(""); prevToken = line; if (line.equals("\n")) continue;
StringTokenizer st2 = new StringTokenizer(line, " \t", true); Sumeet Dhende (2012450009) Jeet Dholakia (2012450010) Page 68
Page 69
Page 70
Page 72
Page 73
Page 74
Page 76
return true; } //for checking the information from the text field public boolean isCorrect() { Sumeet Dhende (2012450009) Jeet Dholakia (2012450010)
Page 77
Page 79
Page 81
Page 82
//for adding the action listener for the button to dispose the frame exitButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { dispose(); } Sumeet Dhende (2012450009) Jeet Dholakia (2012450010)
Page 83
//constructor of removeBooks public RemoveBooks() { //for setting the title for the internal frame Sumeet Dhende (2012450009) Jeet Dholakia (2012450010) Page 85
Page 86
removeTextField.setText(null); } if (numberOfBooks > 1) { numberOfBooks -= 1; book.update("UPDATE Books SET NumberOfBooks =" + numberOfBooks + " WHERE BookID =" + data); //for setting JTextField to null
JOptionPane.showMessageDialog(null, "The BookID is wrong!", "Error", JOptionPane.ERROR_MESSAGE); } }; runner.start(); } //if there is a missing data, then display Message Dialog else { JOptionPane.showMessageDialog(null, "Please, complete the information", "Warning", JOptionPane.WARNING_MESSAGE); } } }); //for adding the action listener for the button to dispose the frame exitButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { dispose(); } }); //for setting the visible to true setVisible(true); //show the internal frame pack(); } Sumeet Dhende (2012450009) Jeet Dholakia (2012450010) Page 89
//constructor of removeMembers public RemoveMembers() { //for setting the title for the internal frame super("Remove Members", false, true, false, true); //for setting the icon setFrameIcon(new ImageIcon(ClassLoader.getSystemResource("images/Delete16.gif"))); //for getting the graphical user interface components display area Container cp = getContentPane(); Sumeet Dhende (2012450009) Jeet Dholakia (2012450010)
Page 91
Page 93
JOptionPane.showMessageDialog(null, "Book(s) borrowed by the member", "Warning", JOptionPane.WARNING_MESSAGE); } }; runner.start(); } //if there is a missing data, then display Message Dialog else { JOptionPane.showMessageDialog(null, "Please, complete the information", "Warning", JOptionPane.WARNING_MESSAGE); } } }); //for adding the action listener for the button to dispose the frame exitButton.addActionListener(new ActionListener() { Sumeet Dhende (2012450009) Jeet Dholakia (2012450010) Page 94
Page 95
Main Window:
Page 96
List of Books:
Page 97
Remove Books:
Page 98
Members List:
Page 99
Search Function:
Page 100
Book Reservation:
Page 101
Another enhancement would be to add more modules like online library, course
Also, a release of API version is planned so the system can be integrated with other third-
party applications. It will enhance the document management within other applications
Page 102
Number of server machines is assumed to be more with more number of users accessing
the system. But if the user limit exceeds, it can slow down the server system and congest the network.
Page 103
Page 104
www.google.com.
www.wikipedia.com
www.w3schools.com Head First PHP & MySQL by Lynn Beighley and Michael Morrison(OReilly)
Page 105