Вы находитесь на странице: 1из 88

Library Management System

Mini Project Report

On

LIBRARY MANAGEMENT
SYSTEM

Submitted By:

YOGENDRA SINGH
VERMA

In partial fulfillment for the award of the degree of

MCA DEGREE

In

COMPUTER SCIENCE & INFORMATICS


UNIVERSITY OF KOTA
KOTA
SEPTEMBER 2019

Computer Science And Infomatics Page 1


Library Management System

COMPUTER SCIENCE & INFORMATICS

UNIVERSITY OF KOTA
KOTA
SEPTEMBER 2019

CERTIFICATE
Certified that this is a bonafide record of the project work titled

LIBRARY MANAGEMENT SYSTEM


Done by

YOGENDRA SINGH VERMA


of V sem. Dept. Of Computer Science & Informatics in the year 2019
University Of Kota
Kota

Dr.O.P.Rishi Dr.O.P.Rishi
Project Guide Head of the Dept.

Computer Science And Infomatics Page 2


Library Management System

ACKNOWLEDGEMENT

I take this occasion to thank God, almighty for blessing us with his grace and taking our

endeavor to a successful culmination. I extend our sincere and heartfelt thanks to our esteemed

guide, Dr. O.P. Rishi, for providing us with the right guidance and advice at the crucial

junctures and for showing me the right way. I extend our sincere thanks to our respected Head of

the Dept. Dr. O.P. Rishi, for allowing us to use the facilities available. I would like to thank the

other faculty members also, at this occasion. Last but not the least, I would like to thank our

friends and family for the support and encouragement they have given us during the course of

our work.

Computer Science And Infomatics Page 3


Library Management System

TABLE OF CONTENTS

ABSTRACT 5

1. INTRODUCTION 6
PROJECT AIMS AND OBJECTIVES 6
BACKGROUND OF PROJECT 7
OPERATION ENVIRONMENT 8

2. SYSTEM ANALYSIS 9
SOFTWARE REQUIREMENT SPECIFICATION 9
EXISTING VS PROPOSED 15
SOFTWARE TOOL USED 16

3. SYSTEM DESIGN 20
TABLE DESIGN 20
DATA FLOW DIAGRAM’S 24
4. SYSTEM IMPLEMENTATION 30
MODULE DESCRIPTION 30
SCREEN SHOTS 80
5. SYSTEM TESTING 85
UNIT TESTING 85
INTEGRATION TESTING 87
6. CONCLUSION & FUTURE SCOPE 88
7. REFERENCES 89

Computer Science And Infomatics Page 4


Library Management System

ABSTRACT

Library management system is a project which aims in developing a computerized


system to maintain all the daily work of library .This project has many features
which are generally not availiable in normal library management systems like
facility of user login and a facility of teachers login .It also has a facility of admin
login through which the admin can monitor the whole system .It also has facility
of an online notice board where teachers can student can put up information about
workshops or seminars being held in our colleges or nearby colleges and librarian
after proper verification from the concerned institution organizing the seminar can
add it to the notice board . It has also a facility where student after logging in their
accounts can see list of books issued and its issue date and return date and also the
students can request the librarian to add new books by filling the book request
form.The librarian after logging into his account ie admin account can generate
various reports such as student report , issue report, teacher report and book report

Overall this project of ours is being developed to help the students as well as staff
of library to maintain the library in the best way possible and also reduce the
human efforts.

Computer Science And Infomatics Page 5


Library Management System

CHAPTER 1
INTRODUCTION

This chapter gives an overview about the aim , objectives ,background and operation
environment of the system.

PROJECT AIMS AND OBJECTIVES


The project aims and objectives that will be achieved after completion of this project are
discussed in this subchapter. The aims and objectives are as follows:

 Request column for librarian for providing new books


 A separate column for digital library
 Student login page where student can find books issued by him/her and date of return.
 A search column to search availability of books
 A teacher login page where teacher can add any events being organized in the college
and important suggestions regarding books.
 Online notice board about the workshop.

Computer Science And Infomatics Page 6


Library Management System

BACKGROUND OF PROJECT

Library Management System is an application which refers to library systems which are
generally small or medium in size. It is used by librarian to manage the library using a
computerized system where he/she can record various transactions like issue of books, return of
books, addition of new books, addition of new students etc.

Books and student maintenance modules are also included in this system which would keep track
of the students using the library and also a detailed description about the books a library
contains. With this computerized system there will be no loss of book record or member record
which generally happens when a non computerized system is used.

In addition, report module is also included in Library Management System. If user’s position is
admin, the user is able to generate different kinds of reports like lists of students registered, list
of books, issue and return reports.

All these modules are able to help librarian to manage the library with more convenience and in
a more efficient way as compared to library systems which are not computerized.

Computer Science And Infomatics Page 7


Library Management System

OPERATION ENVIRONMENT

PROCESSOR INTEL CORE PROCESSOR OR BETTER


PERFORMANCE

OPERATING SYSTEM WINDOWS VISTA ,WINDOWS7, UBUNTU

MEMORY 1GB RAM OR MORE

HARD DISK SPACE MINIMUM 3 GB FOR DATABASE USAGE FOR


FUTURE
DATABASE MY SQL

Computer Science And Infomatics Page 8


Library Management System

CHAPTER 2

SYSTEM ANALYSIS

In we will discuss and analyze about the developing process of Library Management
System including software requirement specification (SRS) and comparison between
existing and proposed system . The functional and non functional requirements are
included in SRS part to provide complete description and overview of system
requirement before the developing process is carried out. Besides that, existing vs
proposed provides a view of how the proposed system will be more efficient than the
existing one.

SOFTWARE REQUIREMENT SPECIFICATION


GENERAL DESCRIPTION

PRODUCT DESCRIPTION:
Library Management System is a computerized system which helps
user(librarian) to manage the library daily activity in electronic format. It reduces
the risk of paper work such as file lost, file damaged and time consuming.
It can help user to manage the transaction or record more effectively and time-
saving.

PROBLEM STATEMENT:
The problem occurred before having computerized system includes:
 File lost
When computerized system is not implemented file is always lost because of human
environment.Some times due to some human error there may be a loss of records.

 File damaged When a computerized system is not there file is always lost due to
some accdent like spilling of water by some member on file accidentally.Besides
some natural disaster like floods or fires may also damage the files.

Computer Science And Infomatics Page 9


Library Management System

 Difficult to search record


When there is no computerized system there is always a difficulty in searching of
records if the records are large in number .
 Space consuming
After the number of records become large the space for physical storage of file and
records also increases if no computerized system is implemented.
 Cost consuming
As there is no computerized system the to add each record paper will be needed
which will increase the cost for the management of library.
SYSTEM OBJECTIVES
 Improvement in control and performance
The system is developed to cope up with the current issues and problems of library
The system can add user, validate user and is also bug free.
 Save cost
After computerized system is implemented less human force will be required to
maintain the library thus reducing the overall cost.
 Save time
Librarian is able to search record by using few clicks of mouse and few search
keywords thus saving his valuable time.
 Option of online Notice board
Librarian will be able to provide a detailed description of workshops going in the
college as well as in nearby colleges
 Lecture Notes
Teacher have a facility to upload lectures notes in a pdf file having size not more
than 10mb

Computer Science And Infomatics Page 10


Library Management System

SYSTEM REQUIREMENTS
NON FUNCTIONAL REQUIREMENTS
 Product Requirements
EFFICIENCY REQUIREMENT
When a library management system will be implemented librarian and user will
easily acess library as searching and book transaction will be very faster .

RELIABILITY REQUIREMENT
The system should accurately performs member registration ,member validation ,
report generation, book transaction and search

USABILITY REQUIREMENT
The system is designed for a user friendly environment so that student and staff of
library can perform the various tasks easily and in an effective way.

ORGANIZATIONAL REQUIREMENT
IMPLEMENTATION REQUIREMNTS
In implementing whole system it uses html in front end with php as server side
scripting language which will be used for database connectivity and the backend ie
the database part is developed using mysql.

DELIVERY REQUIREMENTS
The whole system is expected to be delivered in six months of time with a weekly
evaluation by the project guide.

Computer Science And Infomatics Page 11


Library Management System

FUNCTIONAL REQUIREMENTS
1. NORMAL USER

USER
LOGIN
Descriptio
n of feature
This feature used by the user to login into system. They are required to enter user id and
password before they are allowed to enter the system .The user id and password will be verified
and if invalid id is there user is allowed to not enter the system.

Functional requirements
-user id is provided when they register
-The system must only allow user with valid id and password to enter the system
-The system performs authorization process which decides what user level can acess to.
-The user must be able to logout after they finished using system.

REGISTER NEW USER


Description of feature
This feature can be performed by all users to register new user to create account.

Functional requirements
-System must be able to verify information
-System must be able to delete information if information is wrong

REGISTER NEW BOOK


Description of feature
This feature allows to add new books to the library
Functional requirements
-System must be able to verify information
-System must be able to enter number of copies into table.
Computer Science And Infomatics Page 12
Library Management System
- System must be able to not allow two books having same book id.

Computer Science And Infomatics Page 13


Library Management System

1.5 SEARCH BOOK

DESCRIPTION OF FEATURE
This feature is found in book maintenance part . we can search book based on book id ,
book name , publication or by author name.

Functional requirements
- System must be able to search the database based on select search type
- System must be able to filter book based on keyword enterd
- System must be able to show the filtered book in table view

ISSUE BOOKS AND RETURN BOOKS

DESCRIPTION OF FEATURE
This feature allows to issue and return books and also view reports of book issued.

Functional requirements
-System must be able to enter issue information in database.
-System must be able to update number of books.
- System must be able to search if book is available or not before issuing books
-System should be able to enter issue and return date information

EVENT ADDITION

DESCRIPTION OF FEATURE
This feature allows teacher and student to add information about various workshops being
conducted in college and colleges nearby.

Computer Science And Infomatics Page 14


Library Management System

Functional requirements
-System should be able to add detailed information about events .
-System should be able to display information on notice board available in the homepage of
site

SOFTWARE AND HARDWARE REQUIREMENTS


This section describes the software and hardware requirements of the system
SOFTWARE REQUIREMENTS
 Operating system- Windows 7 is used as the operating system as it is stable
and supports more features and is more user friendly
 Database MYSQL-MYSQL is used as database as it easy to maintain and retrieve
records by simple queries which are in English language which are easy to
understand and easy to write.
 Development tools and Programming language-Java is used to write the whole
code and Design.

HARDWARE REQUIREMENTS
 Intel core i3 2nd generation is used as a processor because it is fast than other
processors an provide reliable and stable and we can run our pc for longtime.
By using this processor we can keep on developing our project without any
worries.
 Ram 1 gb is used as it will provide fast reading and writing capabilities and
will in turn support in processing

Computer Science And Infomatics Page 15


Library Management System

EXISTING VS PROPOSED SYSTEM

i. Existing system does not have any facility of teachers login or student login
where as proposed system will have a facility of student login as well as
teacher’s login
ii. Existing system does not have a facility of online reservation of books whereas
proposed system has a facility of online reservation of books
iii. Existing system does not have any facility of online notice board where
description of workshops happening in our college as well as nearby colleges is
being provided.
iv. Existing system does not has any option of lectures notes uploaded by teachers
whereas proposed system will have this facility
v. Existing system does not have any facility to generate student reports as well
book issue reports whereas proposed system provides librarian with a tool to
generate reports
vi. Existing system does not has any facility for book request and sugeestions
where as in proposed system after logging in to their accounts student can
request books as well as provide suggestions to improve library

Computer Science And Infomatics Page 16


Library Management System

SOFTWARE TOOLS USED


The whole Project is divided in two parts the front end and the back end.

Front end

 JAVA- Java is a general-purpose programming language that is class-


based, object-oriented (although not a pure object-oriented language, as it
contains primitive types, and designed to have as few
implementation dependencies as possible. It is intended to let application
developers write once, run anywhere (WORA), meaning that compiled Java
code can run on all platforms that support Java without the need for
recompilation. Java applications are typically compiled to bytecode that can
run on any Java virtual machine (JVM) regardless of the
underlying computer architecture. The syntax of Java is similar
to C and C++, but it has fewer low-level facilities than either of them. As of
2019, Java was one of the most popular programming languages in
use according to GitHub, particularly for client-server web applications, with
a reported 9 million developers

Computer Science And Infomatics Page 17


Library Management System
 NetBeans IDE:- Most developers recognize the NetBeans IDE as the original free
Java IDE. It is that, and much more! The NetBeans IDE provides support for several
languages (PHP, JavaFX, C/C++, JavaScript, etc.) and frameworks.
NetBeans is an open-source project dedicated to providing rock solid software
development products (the NetBeans IDE and the NetBeans Platform) that address
the needs of developers, users and the businesses who rely on NetBeans as a basis
for their products; particularly, to enable them to develop these products quickly,
efficiently and easily by leveraging the strengths of the Java platform and other
relevant industry standards.

In June 2000, NetBeans was made open source by Sun Microsystems, which
remained the project sponsor until January 2010 when Sun Microsystems became a
subsidiary of Oracle. Please see our History section for more information.

Computer Science And Infomatics Page 18


Library Management System
BACK END- The back end is designed using mysql which I used to design the databases

 MYSQL- MySQL ("My S-Q-L", officially, but also called "My Sequel") is (as of
July 2013) the world's second most widely used open-source relational database
management system (RDBMS). It is named after co-founder Michael Widenius
daughter, My. The SQL phrase stands for Structured Query Language. The
MySQL development project has made its source code available under the terms
of the GNU General Public License, as well as under a variety
of proprietary agreements. MySQL was owned and sponsored by a single for-
profit firm, the Swedish company MySQL AB, now owned by Oracle Corporation
.MySQL is a popular choice of database for use in web applications, and is a
central component of the widely used LAMP open source web application
software stack (and other 'AMP' stacks). LAMP is an acronym for "Linux, Apache,
MySQL, Perl/PHP/Python." Free-software-open source projects that require a
full-featured database management system often use MySQL. For commercial
use, several paid editions are available, and offer additional functionality.
Applications which use MySQL databases

Computer Science And Infomatics Page 19


Library Management System

include: TYPO3, MODx, Joomla, WordPress, phpBB, MyBB, Drupal and other
software. MySQL is also used in many high-profile, large-scale websites,
including Wikipedia, Google (though not for
searches), Facebook, Twitter, Flickr, and YouTube

Computer Science And Infomatics Page 20


Library Management System

CHAPTER 3
SYSTEM DESIGN

TABLE DESIGN

VARIOUS TABELS TO MAINTAIN


INFORMATION
 BOOK TABLE FOR KEEPING TRACK OF BOOKS

Field Data type Default Key Extra


Code INT(11) Not Null Primary Auto
increment
Bookname VARCHAR(255) Null
Author VARCHAR(255) Null
Publication VARCHAR(255) Null
Subject VARCHAR(255) Null
No of INT(10) Null
copies

Computer Science And Infomatics Page 21


Library Management System

 STUDENT TABLE FOR STUDENT INFORMATION

Field Data type Default Key Extra

libid INT(11) NOT NULL Primary key Auto increment


regno INT(10) NULL
branch VARCHAR(255) NULL
section VARCHAR(255) NULL
semester VARCHAR(255) NULL
section VARCHAR(2) NULL
yearofadm INT(5) NULL

 TEACHER TABLE TO KEEP TEACHER INFORMATION

Field Data Type Default Key Extra

Tid INT(11) NOT NULL Primary key Auto


increment
Name VARCHAR(255) NULL

Designation VARCHAR(255) NULL

Branch VARCHAR(255) NULL

Contactno INT(13) NULL

Lectures LONG BLOB NULL

Computer Science And Infomatics Page 22


Library Management System

 Issue table to keep track of books issued

Field Data Type Default Key Extra

bookid INT(11) NOT NULL Foreign key References


book
stuid INT(11) NOT NULL Foreign key References
Student
issuedate DATE NULL

returndate DATE NULL

 STUDENT LOGIN TABLE


Field Data type Default Key Extra

logid INT(11) NOT NULL Foreign key References


Student
Username VARCHAR(255) NULL

Password VARCHAR(255) NULL

numbooks INT(1) NULL

Computer Science And Infomatics Page 23


Library Management System

 EVENT TABLE FOR EVENT INFORMATION

Field Data type Default Key Extra

Name Varchar(255) NULL


Date Date(yyyy/mm/dd) NULL
Time VARCHAR(255) NULL
Mname VARCHAR(255) NULL
Contactno. Int(30) NULL
Email VARCHAR(255) NULL
Venue varchar(255) NULL

 TEACHER LOGIN TABLE

Field Data Type Default Key Extra

Loginid INT(11) NOT NULL Foreign References


key teacher

Username VARCHAR(255) NULL

Password VARCHAR(255) NULL

Computer Science And Infomatics Page 24


Library Management System

DATA FLOW DIAGRAMS

DATA FLOW DIAGRAM FOR TEACHER LOGIN

TEACHER
DATABASE

ENTER
ENTER USERNAME CHECK
TEACHER URL & VALIDITY
PASSWORD

IF VALID

TEACHER
WEB SERVER LOGIN
PAGE

After entering to the home page of the website , teacher can choose the TEACHER LOGIN
option where they are asked to enter username & password , and if he/she is a valid user then
a teacher login page will be displayed.

Computer Science And Infomatics Page 25


Library Management System

DATA FLOW DIAGRAM FOR STUDENT LOGIN

STUDENT
DATABASE

ENTER
ENTER USERNAME CHECK
STUDENT URL & VALIDITY
PASSWORD

IF VALID

STUDENT
WEB SERVER LOGIN
PAGE

After entering to the home page of the website , student can choose the STUDENT LOGIN
option where they are asked to enter username & password , and if he/she is a valid user then
a student login page will be displayed.

Computer Science And Infomatics Page 26


Library Management System

DATA FLOW DIAGRAM FOR BOOK ISSUE

LOGIN
DATABASE

IF NO.
STUDENT SELECT ENTER IF OF UPDATE MESSAGE
BOOK BOOK SELECT
LOGIN ISSUE DETAIL BOOK
NO. “BOOK
BOOK OF
PAGE AVBL ISSUE
ISSUED COPIES RESERVED”
LESS THAN
3

BOOK LOGIN BOOK


DATABASE TABLE DATABASE

It is a 2nd level Data Flow Diagram where after entering STUDENT LOGIN page he/she can select
a book issue option where after entering the book detail, he/she can select the book issue
option and if the maximum no of books issued limit is not crossed then a request will be sent to
the librarian who will approve the book issue.

Computer Science And Infomatics Page 27


Library Management System

DATA FLOW DIAGRAM FOR BOOK SEARCH

IF
SELECT ENTER
ADVANCE BOOK BOOK
HOME FOUND
SEARCH DETAIL DETAILS

BOOK
DATABASE

After the home page login there will be an option of the book search where after entering book
detail like author name, publication, book name etc book details will be displayed.

Computer Science And Infomatics Page 28


Library Management System

DATA FLOW DIAGRAM FOR ACCOUNT CREATION

SELECT ENTER ADMIN MESSAGE


HOME VERIFY
ACCOUNT STUDENT SENT
CREATION DETAIL STUDEN TO
T STUDENT
IF ALL REG. IS IF VALID
PARTIALLY FILLED

ADMIN STUDENT
DATABASE DATABASE

After the home page login there will be an option of CREATE AN ACCOUNT where after
entering student detail ,if all the fields are filled then a request will be sent to the librarian who
will approve him as a registered member of the library.

Computer Science And Infomatics Page 29


Library Management System

CHAPTER 4
SYSTEM IMPLEMENTATION

4.1.1 Screenshot for homepage

Computer Science And Infomatics Page 30


Library Management System

MODULE DESCRIPTION

For Library Management System it is divided into the following Modules:

Admin Module

ADMIN

STUDENT TEACHER BOOK ADDITION REPORT


VALIDATION REGISTRATION GENERATION

The following module contains various facilities like student validation, teacher
registration, book addition, and report generation.

4.1.1.1 Code for Admin module


Code for entering admin username and password
package libarary.management.system;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.UIManager;

/**
*
* @author h
*/
public class login extends javax.swing.JFrame {

/**
* Creates new form login
*/
public login() {
initComponents();

}
Computer Science And Infomatics Page 31
Library Management System
Connection con;

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jPanel1 = new javax.swing.JPanel();


jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jButton3 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jLabel4 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jPasswordField1 = new javax.swing.JPasswordField();
jButton4 = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setResizable(false);

jPanel1.setBackground(new java.awt.Color(204, 204, 204));


jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Login",
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New
Roman", 0, 24), new java.awt.Color(0, 0, 153))); // NOI18N
jPanel1.setToolTipText("");

jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N


jLabel1.setText("Username");

jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N


jLabel2.setText(" Password");

jButton3.setBackground(new java.awt.Color(255, 255, 255));


jButton3.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-
password-24.png"))); // NOI18N
jButton3.setText("ForgetPassword");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
Computer Science And Infomatics Page 32
Library Management System
jButton3ActionPerformed(evt);
}
});

jButton1.setBackground(new java.awt.Color(255, 255, 255));


jButton1.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
jButton1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/user.png"))); // NOI18N
jButton1.setText("Login");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-
password-24.png"))); // NOI18N

jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-
username-24.png"))); // NOI18N

jButton4.setBackground(new java.awt.Color(255, 255, 255));


jButton4.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
jButton4.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/delete.png"))); // NOI18N
jButton4.setText("Cancel");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);


jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(130, 130, 130)
.addComponent(jButton3))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()

Computer Science And Infomatics Page 33


Library Management System
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAIL
ING)
.addComponent(jLabel2)
.addComponent(jLabel1))
.addGap(41, 41, 41)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jButton1)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton4))
.addGroup(jPanel1Layout.createSequentialGroup()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG, false)
.addComponent(jPasswordField1,
javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
.addComponent(jTextField1))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addComponent(jLabel3)
.addComponent(jLabel4,
javax.swing.GroupLayout.Alignment.TRAILING))))))
.addContainerGap(39, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAIL
ING)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addComponent(jLabel3))
.addGap(27, 27, 27)
Computer Science And Infomatics Page 34
Library Management System

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAIL
ING)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jLabel2)
.addComponent(jPasswordField1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jLabel4))
.addGap(18, 18, 18)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jButton1)
.addComponent(jButton4))
.addGap(17, 17, 17)
.addComponent(jButton3)
.addGap(15, 15, 15))
);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());


getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);

pack();
setLocationRelativeTo(null);
}// </editor-fold>
Computer Science And Infomatics Page 35
Library Management System

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

String name=jTextField1.getText();
String pas=jPasswordField1.getText();

try{
connect();
Statement st = con.createStatement();
String qry = "select username,password from SignUp";
ResultSet rs = st.executeQuery(qry);

if(rs.next())
{
String uname = rs.getString("username");
String pass = rs.getString("password");

if(uname.equals(name) && pass.equals(pas)){

//JOptionPane.showMessageDialog(null,"Login SuccessFully");
pro ob = new pro();
ob.setUpLoading();
ob.setVisible(true);
this.setVisible(false);

}
else if(name.equals(""))
{
JOptionPane.showMessageDialog(null,"Please Enter Username");

}
else if(pas.equals(""))
{
JOptionPane.showMessageDialog(null,"Please Enter Password");

}
else
{
JOptionPane.showMessageDialog(null,"Please Check Username or
Password");

}
Computer Science And Infomatics Page 36
Library Management System
}

}catch(Exception e){

}
// TODO add your handling code here:
}

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {


this.setVisible(false);
new ForgetPasswod().setVisible(true);
// TODO add your handling code here:
}

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

/**
* @param args the command line arguments
*/

public void connect()


{
String curdir = System.getProperty("user.dir");

try{
con = DriverManager.getConnection("jdbc:derby:Library","root","root");

}
catch(Exception e){

}}

public static void main(String args[]) {

/* Set the Nimbus look and feel */


//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and
feel.
* For details see
Computer Science And Infomatics Page 37
Library Management System
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
/* if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}*/
UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel");
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new login().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JPanel jPanel1;
Computer Science And Infomatics Page 38
Library Management System
private javax.swing.JPasswordField jPasswordField1;
private javax.swing.JTextField jTextField1;
// End of variables declaration
}

 Code For ADD USER

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

package libarary.management.system;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.JOptionPane;
import javax.swing.UIManager;

/**
*
* @author h
*/
public class SignUp extends javax.swing.JFrame {

/**
* Creates new form SignUp
*/
public SignUp() {
initComponents();
}
Connection con;

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jPanel1 = new javax.swing.JPanel();


Computer Science And Infomatics Page 39
Library Management System
jButton2 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
jPasswordField1 = new javax.swing.JPasswordField();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jTextField4 = new javax.swing.JTextField();
jComboBox1 = new javax.swing.JComboBox();

setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setResizable(false);

jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "SignUp",
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New
Roman", 0, 24), new java.awt.Color(0, 204, 51))); // NOI18N

jButton2.setBackground(new java.awt.Color(255, 255, 255));


jButton2.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/left-
arrow.png"))); // NOI18N
jButton2.setText("Back");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

jButton1.setBackground(new java.awt.Color(255, 255, 255));


jButton1.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/create-
new-pencil-button.png"))); // NOI18N
jButton1.setText("Create");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

jLabel5.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N


jLabel5.setText("Password");

jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N


Computer Science And Infomatics Page 40
Library Management System
jLabel3.setText("Security Question");

jLabel4.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N


jLabel4.setText("Answer");

jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N


jLabel1.setText("Name");

jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N


jLabel2.setText("Username");

jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] {


"What is Your Nick Name.", "What is Your Favorite Color.", "What is Your DOB.", "What
is Your Favorite Food.", "What is Your Weakness." }));

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);


jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG, false)
.addGroup(jPanel1Layout.createSequentialGroup()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addComponent(jLabel1)
.addComponent(jLabel2))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addComponent(jTextField2,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 161,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField1,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 161,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jLabel3)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
Computer Science And Infomatics Page 41
Library Management System

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addComponent(jLabel4)
.addComponent(jLabel5))

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(79, 79, 79)
.addComponent(jComboBox1,
javax.swing.GroupLayout.PREFERRED_SIZE, 161,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addComponent(jPasswordField1,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 161,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField4,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 161,
javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(45, 45, 45)
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(0, 0, 0)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
Computer Science And Infomatics Page 42
Library Management System
27, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 23,
Short.MAX_VALUE)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jLabel3)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(13, 13, 13)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE,
29, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jPasswordField1,
javax.swing.GroupLayout.PREFERRED_SIZE, 29,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5))
.addGap(27, 27, 27)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton2))
.addContainerGap())
);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());


getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
Computer Science And Infomatics Page 43
Library Management System
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);

pack();
setLocationRelativeTo(null);
}// </editor-fold>

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

String uname=jTextField1.getText();
String name=jTextField2.getText();
String que=(String) jComboBox1.getSelectedItem();
String ans = jTextField4.getText();
String pass=jPasswordField1.getText();

if(uname.equals(""))
{
JOptionPane.showMessageDialog(null,"Enter Your Name");
}
else if(name.equals(""))
{
JOptionPane.showMessageDialog(null,"Enter Username");
}
else if(ans.equals(""))
{
JOptionPane.showMessageDialog(null,"Enter Answer Of your Question");
}
else{
try{
connect();
Statement st = con.createStatement();
String qry = ("insert into SignUp
(name,username,secuque,answer,password)values('"+uname+"','"+name+"','"+que+"','"+ans+
"','"+pass+"')");
st.executeUpdate(qry);
Computer Science And Infomatics Page 44
Library Management System
JOptionPane.showMessageDialog(rootPane,"Registration Success");
this.setVisible(false);
new login().setVisible(true);

}catch(Exception e){

}
}

// TODO add your handling code here:


}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


this.setVisible(false);
new login().setVisible(true);
// TODO add your handling code here:
}

/**
* @param args the command line arguments
*/
public void connect()
{
String curdir = System.getProperty("user.dir");

try{
con = DriverManager.getConnection("jdbc:derby:Library","root","root");

}
catch(Exception e){

}}
public static void main(String args[]) {

/* Set the Nimbus look and feel */


//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and
feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
/* if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
Computer Science And Infomatics Page 45
Library Management System
break;
}*/
UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel");
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(SignUp.class.getName()).log(java.util.logging.Level.SE
VERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(SignUp.class.getName()).log(java.util.logging.Level.SE
VERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(SignUp.class.getName()).log(java.util.logging.Level.SE
VERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(SignUp.class.getName()).log(java.util.logging.Level.SE
VERE, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new SignUp().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JComboBox jComboBox1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JPanel jPanel1;
private javax.swing.JPasswordField jPasswordField1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField4;
// End of variables declaration
}
Computer Science And Infomatics Page 46
Library Management System
 Code For Forget Password

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

package libarary.management.system;

import java.sql.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import javax.swing.JOptionPane;
import javax.swing.UIManager;

/**
*
* @author h
*/
public class ForgetPasswod extends javax.swing.JFrame {

/**
* Creates new form ForgetPasswod
*/
public ForgetPasswod() {
initComponents();
}
Connection con;
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jPanel1 = new javax.swing.JPanel();


jButton2 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
jPasswordField1 = new javax.swing.JPasswordField();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
Computer Science And Infomatics Page 47
Library Management System
jTextField1 = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jTextField4 = new javax.swing.JTextField();
jComboBox1 = new javax.swing.JComboBox();

setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setResizable(false);

jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null,
"ForgetPasssword", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New
Roman", 0, 24), new java.awt.Color(255, 0, 102))); // NOI18N

jButton2.setBackground(new java.awt.Color(255, 255, 255));


jButton2.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/left-
arrow.png"))); // NOI18N
jButton2.setText("Back");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

jButton1.setBackground(new java.awt.Color(255, 255, 255));


jButton1.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/refresh-
page-option.png"))); // NOI18N
jButton1.setText("Reset");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

jLabel5.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N


jLabel5.setText("Password");

jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N


jLabel3.setText("Security Question");

jLabel4.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N


jLabel4.setText("Answer");

jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N


jLabel1.setText("Username");
Computer Science And Infomatics Page 48
Library Management System

jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N


jLabel2.setText("Name");

jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] {


"what is your nick name", "What is Your Favorite Color.", "What is Your DOB.", "What is
Your Favorite Food.", "What is Your Weakness." }));

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);


jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG, false)
.addGroup(jPanel1Layout.createSequentialGroup()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addComponent(jLabel1)
.addComponent(jLabel2))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addComponent(jTextField2,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 161,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField1,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 161,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(50, 50, 50)
.addComponent(jButton1)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE,
91, javax.swing.GroupLayout.PREFERRED_SIZE))
Computer Science And Infomatics Page 49
Library Management System
.addGroup(jPanel1Layout.createSequentialGroup()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addComponent(jLabel5)
.addComponent(jLabel3))
.addGap(29, 29, 29)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addComponent(jComboBox1,
javax.swing.GroupLayout.PREFERRED_SIZE, 161,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jPasswordField1,
javax.swing.GroupLayout.PREFERRED_SIZE, 161,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jTextField4,
javax.swing.GroupLayout.Alignment.TRAILING)))))
.addComponent(jLabel4))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(3, 3, 3)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jLabel1)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
20, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(19, 19, 19))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
Computer Science And Infomatics Page 50
Library Management System
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)))

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jLabel3)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addGap(20, 20, 20)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jLabel5)
.addComponent(jPasswordField1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASEL
INE)
.addComponent(jButton1)
.addComponent(jButton2))
.addContainerGap())
);

jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new
java.awt.Component[] {jComboBox1, jLabel1, jLabel2, jLabel3, jLabel4, jLabel5,
jPasswordField1, jTextField1, jTextField2, jTextField4});

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());


getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
Computer Science And Infomatics Page 51
Library Management System
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);

pack();
setLocationRelativeTo(null);
}// </editor-fold>

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {

this.setVisible(false);
new login().setVisible(true);
// TODO add your handling code here:
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


String uname=jTextField1.getText();
String name=jTextField2.getText();
String que=(String) jComboBox1.getSelectedItem();
String ans = jTextField4.getText();
String pass=jPasswordField1.getText();

try{
connect();
Statement st = con.createStatement();
String qry ="select username,secuque,answer from signup";
ResultSet rs=st.executeQuery(qry);

if(rs.next()){
String check = rs.getString("secuque");
String check1 = rs.getString("answer");
String check2 = rs.getString("username");

if(!uname.equals(check2)){

Computer Science And Infomatics Page 52


Library Management System
JOptionPane.showMessageDialog(null,"Invalid Username");

}
else if(check.equals(que) && check1.equals(ans)){

String query = "Update signup set password='"+pass+"' where


username='"+uname+"'";
st.executeUpdate(query);
JOptionPane.showMessageDialog(rootPane,"Password Updated
Successful");
this.setVisible(false);
new login().setVisible(true);
}
else
{
JOptionPane.showMessageDialog(null,"Wrong Answer");
}
}

}catch(Exception e){

// TODO add your handling code here:


}
public void connect()
{

String curdir = System.getProperty("user.dir");


try{
con = DriverManager.getConnection("jdbc:derby:Library","root","root");

}
catch(Exception e){

}
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and
feel.
Computer Science And Infomatics Page 53
Library Management System
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
/*if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}*/
UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel");
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(ForgetPasswod.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(ForgetPasswod.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(ForgetPasswod.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(ForgetPasswod.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ForgetPasswod().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JComboBox jComboBox1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
Computer Science And Infomatics Page 54
Library Management System
private javax.swing.JLabel jLabel5;
private javax.swing.JPanel jPanel1;
private javax.swing.JPasswordField jPasswordField1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField4;
// End of variables declaration
}

 Code For Progress Bar


package libarary.management.system;

import java.awt.Color;
import static javafx.scene.paint.Color.color;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.UIManager;

/**
*
* @author h
*/
public class pro extends javax.swing.JFrame implements Runnable{
int s=0;
Thread th;

/**
* Creates new form pro
*/
public pro() {
super("pro");
initComponents();
th=new Thread((Runnable)this);
}
public void setUpLoading()
{
setVisible(false);
th.start();
}
public void run()
{

try{
for(int i=1;i<=200;i++){
Computer Science And Infomatics Page 55
Library Management System
s=s+1;
// UIManager.put("jProgressBar2.selectionBackground",Color.green);
//UIManager.put("jProgressBar2.selectionForeground",Color.green);
int m = jProgressBar2.getMaximum();
int v = jProgressBar2.getValue();

if(v<m){
jProgressBar2.setValue(jProgressBar2.getValue()+1);
}else{
i=201;
setVisible(false);

home ob=new home();


ob.setVisible(true);

}Thread.sleep(50);
}
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
}

Computer Science And Infomatics Page 56


Library Management System
public static void main(String args[]) {

/* Set the Nimbus look and feel */


//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
//UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel");
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(pro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(pro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(pro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(pro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new pro().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
private javax.swing.JProgressBar jProgressBar2;
// End of variables declaration

Computer Science And Infomatics Page 57


Library Management System

Code for?>book addition

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


connect();

String bid = jTextField1.getText();


String name = jTextField2.getText();
String pub = jTextField4.getText();
String price = jTextField5.getText();
String pages = jTextField6.getText();
String sql ="insert into books(id,b_name,edition,publisher,price,pages) values (?,?,?,?,?,?)";

if(bid.equals("") || name.equals("") || pub.equals("") || price.equals("") || pages.equals(""))


{
JOptionPane.showMessageDialog(null,"Fill the Blanks Field");
}
else{
try{
pst=con.prepareStatement(sql);
pst.setString(1,jTextField1.getText());
pst.setString(2,jTextField2.getText());
pst.setString(3, (String)jComboBox1.getSelectedItem());
pst.setString(4,jTextField4.getText());
pst.setString(5,jTextField5.getText());
pst.setString(6,jTextField6.getText());
pst.execute();
JOptionPane.showMessageDialog(null,"New Book Added");
} catch(Exception e){

}
}

// TODO add your handling code here:


}

Screenshot for Admin login

Computer Science And Infomatics Page 58


Library Management System

?>

Computer Science And Infomatics Page 59


Library Management System

Student Module

STUDENT

STUDENT STUDENT LOGIN ONLINE BOOK EVENT ADDITION


REGISTRATION RESERVATTION

USERNAME AND FORGOT


PASSWORD PASSWORD
AUTHENTICATION

The following module contains various facilities like student registration, student login,
online book reservation, and event addition. Any student if at any moment forgets his
password he can retrieve it from forgot password option.

Code For Student account creation

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

package libarary.management.system;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Random;
import javax.swing.JOptionPane;
import javax.swing.UIManager;

Computer Science And Infomatics Page 60


Library Management System
/**
*
* @author h
*/
public class add_student extends javax.swing.JFrame {
Connection con;
ResultSet rs;
PreparedStatement pst;
/**
* Creates new form add_student
*/
public add_student() {
super("add_student");
initComponents();
random();

}
public void random(){
Random rd = new Random();
jTextField1.setText(""+rd.nextInt(1000+1));
}

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jPanel1 = new javax.swing.JPanel();


jLabel5 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jComboBox2 = new javax.swing.JComboBox();
jTextField1 = new javax.swing.JTextField();
jComboBox3 = new javax.swing.JComboBox();
jLabel7 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jComboBox4 = new javax.swing.JComboBox();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();

Computer Science And Infomatics Page 61


Library Management System
jTextField3 = new javax.swing.JTextField();
jComboBox1 = new javax.swing.JComboBox();

setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setResizable(false);

jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLin
eBorder(new java.awt.Color(204, 0, 204), 2), "ADD STUDENT",
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 0,
18), new java.awt.Color(255, 0, 153))); // NOI18N

jLabel5.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N


jLabel5.setText("Branch");

jLabel2.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N


jLabel2.setText("Name");

jLabel1.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N


jLabel1.setText("Student ID");

jLabel4.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N


jLabel4.setText("Course");

jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Computer


Science", "Management", "Science", "Arts", "Accounts" }));

jComboBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1st", "2nd ",


"3rd ", "4th ", "5th", "6th" }));

jLabel7.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N


jLabel7.setText("Year");

jLabel3.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N


jLabel3.setText("Father Name");

jLabel6.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N


jLabel6.setText("Semester");

jComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3"


}));

jButton1.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N


jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-add-user-
male-24.png"))); // NOI18N
jButton1.setText("ADD");
Computer Science And Infomatics Page 62
Library Management System
jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton1MouseClicked(evt);
}
});
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

jButton2.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N


jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/left-arrow.png")));
// NOI18N
jButton2.setText("BACK");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "BCA",


"MCA", "B.SC", "M.SC", "BBA", "MBA", "B.COM", "M.COM", "BA", "MA", " " }));

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);


jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 151,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(63, 63, 63)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 151,
javax.swing.GroupLayout.PREFERRED_SIZE))
Computer Science And Infomatics Page 63
Library Management System
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel6)
.addComponent(jLabel7))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 151,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE,
151, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE,
151, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE,
151, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE,
151, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(30, 30, 30)
.addComponent(jButton1)
.addGap(18, 18, 18)
.addComponent(jButton2)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)

Computer Science And Infomatics Page 64


Library Management System
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton2))
.addContainerGap())
);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());


getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
Computer Science And Infomatics Page 65
Library Management System
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);

pack();
setLocationRelativeTo(null);
}// </editor-fold>

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


}

private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {


connect();
String name = jTextField2.getText();
String fatname = jTextField3.getText();
String qry ="insert into student(stu_id,stu_name,fat_name,course,branch,semester,years)
values (?,?,?,?,?,?,?)";

if(name.equals(""))
{
JOptionPane.showMessageDialog(null,"Enter Student Name");
}
else if(fatname.equals(""))
{
JOptionPane.showMessageDialog(null,"Enter Father Name");
}

else{
try{
pst=con.prepareStatement(qry);
pst.setString(1,jTextField1.getText());
pst.setString(2,jTextField2.getText());
pst.setString(3,jTextField3.getText());
pst.setString(4, (String)jComboBox1.getSelectedItem());
pst.setString(5, (String)jComboBox2.getSelectedItem());
pst.setString(6, (String)jComboBox3.getSelectedItem());
pst.setString(7, (String)jComboBox4.getSelectedItem());
pst.execute();

Computer Science And Infomatics Page 66


Library Management System
JOptionPane.showMessageDialog(null,"New Student Added");
}catch(Exception e){
JOptionPane.showMessageDialog(rootPane, e);
}
}

// TODO add your handling code here:


}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


this.setVisible(false);
// new home().setVisible(true);
// TODO add your handling code here:
}
public void connect()
{
String curdir = System.getProperty("user.dir");

try{
con = DriverManager.getConnection("jdbc:derby:Library","root","root");

}
catch(Exception e){

}}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
/*if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}*/
UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel");
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(add_student.class.getName()).log(java.util.logging.Level.SEVERE

Computer Science And Infomatics Page 67


Library Management System
, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(add_student.class.getName()).log(java.util.logging.Level.SEVERE
, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(add_student.class.getName()).log(java.util.logging.Level.SEVERE
, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(add_student.class.getName()).log(java.util.logging.Level.SEVERE
, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new add_student().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JComboBox jComboBox1;
private javax.swing.JComboBox jComboBox2;
private javax.swing.JComboBox jComboBox3;
private javax.swing.JComboBox jComboBox4;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
// End of variables declaration
}

Computer Science And Infomatics Page 68


Library Management System

Computer Science And Infomatics Page 69


Library Management System

 4.1.3 Teacher Module

TEACHER

SUGGESTIONS
TEACHER LOGIN EVENT ADDITION

USERNAME AND FORGOT


PASSWORD PASSWORD
AUTHENTICATION

The following module contains various facilities like teacher login, suggestions, and
event addition. Further any teacher if at any moment forgets his/her password he/she can
retrieve it from ‘forgot password’ option.

Computer Science And Infomatics Page 70


Library Management System

 4.1.4 Book Module

BOOK MAINTENANCE

ADD NEW BOOK SEARCH BOOK

The following module contains various facilities like add new book and search book. In
the ‘add new book’ section if any new book comes in the library then the librarian can
add its specifications. Similarly if the user wants to search for a specific book then
he/she can use search book option to do it.

Code For Adding New books

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


connect();

String bid = jTextField1.getText();


String name = jTextField2.getText();
String pub = jTextField4.getText();
String price = jTextField5.getText();
String pages = jTextField6.getText();
String sql ="insert into books(id,b_name,edition,publisher,price,pages) values (?,?,?,?,?,?)";

if(bid.equals("") || name.equals("") || pub.equals("") || price.equals("") || pages.equals(""))


{
JOptionPane.showMessageDialog(null,"Fill the Blanks Field");
}
else{
try{
pst=con.prepareStatement(sql);
pst.setString(1,jTextField1.getText());
pst.setString(2,jTextField2.getText());

Computer Science And Infomatics Page 71


Library Management System
pst.setString(3, (String)jComboBox1.getSelectedItem());
pst.setString(4,jTextField4.getText());
pst.setString(5,jTextField5.getText());
pst.setString(6,jTextField6.getText());
pst.execute();
JOptionPane.showMessageDialog(null,"New Book Added");
} catch(Exception e){

}
}

// TODO add your handling code here:


}

 4.1.5 Book Transaction Module

BOOK TRANSACTION

ISSUE BOOK RETURN BOOK CHECK


RESERVATION

The following module contains various facilities like issue book, return book and check
reservation.

Computer Science And Infomatics Page 72


Library Management System

Computer Science And Infomatics Page 73


Library Management System

Code For issue book

private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {


connect();
String qry="insert into issue
(book_id,name,edition,publisher,price,pages,student_id,student_name,father_name,course,branch,seme
ster,years,date_of_issue) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
try{
pst = con.prepareStatement(qry);
pst.setString(1, jTextField1.getText());
pst.setString(2,jTextField2.getText());
pst.setString(3, jTextField13.getText());
pst.setString(4, jTextField4.getText());
pst.setString(5, jTextField5.getText());
pst.setString(6, jTextField6.getText());
pst.setString(7, jTextField7.getText());
pst.setString(8, jTextField3.getText());
pst.setString(9, jTextField8.getText());
pst.setString(10, jTextField9.getText());
pst.setString(11, jTextField10.getText());
pst.setString(12, jTextField11.getText());
pst.setString(13, jTextField12.getText());
pst.setString(14, ((JTextField)jDateChooser1.getDateEditor().getUiComponent()).getText());
pst.execute();
JOptionPane.showMessageDialog(null,"Book Issued");
}catch(Exception e)
{
JOptionPane.showMessageDialog(null, e);
}

Code For book Return

Computer Science And Infomatics Page 74


Library Management System

public void return_bo(){


connect();
String sql ="insert into
returnbook(s_id,s_name,fat_name,course,branch,semester,years,book_id,b_name,edition,publisher,pric
e,pages,date_of_issue,date_of_return) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
try{
pst=con.prepareStatement(sql);
pst.setString(1,jTextField7.getText());
pst.setString(2,jTextField3.getText());
pst.setString(3,jTextField8.getText());
pst.setString(4,jTextField9.getText());
pst.setString(5,jTextField10.getText());
pst.setString(6,jTextField11.getText());
pst.setString(7,jTextField12.getText());
pst.setString(8,jTextField1.getText());
pst.setString(9,jTextField2.getText());
pst.setString(10,jTextField13.getText());
pst.setString(11,jTextField4.getText());
pst.setString(12,jTextField5.getText());
pst.setString(13,jTextField6.getText());
pst.setString(14,jTextField14.getText());
pst.setString(15, ((JTextField)jDateChooser2.getDateEditor().getUiComponent()).getText());
pst.execute();
JOptionPane.showMessageDialog(null,"Book Returned Success");
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
}

Computer Science And Infomatics Page 75


Library Management System

Computer Science And Infomatics Page 76


Library Management System

 About US

public class about extends javax.swing.JFrame {

/**
* Creates new form about
*/
public about() {
initComponents();
}

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

Computer Science And Infomatics Page 77


Library Management System
jPanel1 = new javax.swing.JPanel();
jLabel3 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setResizable(false);

jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFac
tory.createLineBorder(new java.awt.Color(0, 51, 204), 2), "About",
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times
New Roman", 0, 24), new java.awt.Color(204, 0, 0))); // NOI18N

jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N


jLabel3.setText("Copyright @2019");

jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N


jLabel5.setText("Mobile:-+916375422034");

jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N


jLabel4.setText("Gmail:-yoyosirr@gmail.com");

jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N


jLabel2.setText("Version 1.0.6");

jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N


jLabel1.setText("Library Management System");

jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IMG-
20180810-WA0089.jpg"))); // NOI18N

jLabel7.setFont(new java.awt.Font("Trebuchet MS", 1, 18)); // NOI18N


jLabel7.setText("Developed By:-Yogendra Singh");

jLabel8.setFont(new java.awt.Font("Trebuchet MS", 1, 18)); // NOI18N


jLabel8.setText("MCA V Semester");

jLabel9.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N


jLabel9.setText("University Of Kota,Kota");

Computer Science And Infomatics Page 78


Library Management System
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel6)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TR
AILING)
.addComponent(jLabel8)
.addComponent(jLabel7))
.addGap(42, 42, 42))
.addGroup(jPanel1Layout.createSequentialGroup()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(46, 46, 46)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addComponent(jLabel5)
.addComponent(jLabel4)
.addComponent(jLabel1)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(115, 115, 115)
.addComponent(jLabel2))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(99, 99, 99)
.addComponent(jLabel3))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(64, 64, 64)
.addComponent(jLabel9)))
.addGap(114, 114, 114))))
);
jPanel1Layout.setVerticalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
Computer Science And Infomatics Page 79
Library Management System
.addContainerGap()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addComponent(jLabel6)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel7)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel8)
.addGap(44, 44, 44)
.addComponent(jLabel9)
.addGap(18, 18, 18)
.addComponent(jLabel1)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3)
.addGap(72, 72, 72)
.addComponent(jLabel4)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5)))
.addContainerGap())
);

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
Computer Science And Infomatics Page 80
Library Management System
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);

pack();
setLocationRelativeTo(null);
}// </editor-fold>

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional)
">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look
and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
/*if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}*/
UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel");
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(about.class.getName()).log(java.util.logging.Level.S
EVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(about.class.getName()).log(java.util.logging.Level.S
EVERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(about.class.getName()).log(java.util.logging.Level.S
EVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(about.class.getName()).log(java.util.logging.Level.S
EVERE, null, ex);
}
//</editor-fold>

Computer Science And Infomatics Page 81


Library Management System
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new about().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
// End of variables declaration
}

Computer Science And Infomatics Page 82


Library Management System

Computer Science And Infomatics Page 83


Library Management System

CHAPTER 5
SYSTEM TESTING

The aim of the system testing process was to determine all defects in our project .The program
was subjected to a set of test inputs and various observations were made and based on these
observations it will be decided whether the program behaves as expected or not.
Our Project went through two levels of testing
1.Unit testing
2.integration testing

UNIT TESTING

Unit testing is undertaken when a module has been created and succesfully reviewed .In order to
test a single module we need to provide a complete environment ie besides the module we
would require
 The procedures belonging to other modules that the module under test calls
 Non local data structures that module accesses
 A procedure to call the functions of the module under test with appropriate
parameters
Unit testing was done on each and every module that is described under module description of
chapter 4

1. Test For the admin module

Computer Science And Infomatics Page 84


Library Management System

 Testing admin login form-This form is used for log in of administrator of


the system.In this we enter the username and password if both are correct
administration page will open other wise if any of data is wrong it will get
redirected back to the login page and again ask for username and password
 Student account addition- In this section the admin can verify student
details from student academinc info and then only add student details to
main library database it contains add and delete buttons if user click add
button data will be added to student database and if he clicks delete button
the student data will be deleted
 Book Addition- Admin can enter details of book and can add the details to
the main book table also he can view the books requests .

2. Test for Student login module


 Test for Student login Form-This form is used for log in of Student .In this
we enter thelibraryid, username and password if all these are correct student
login page will open other wise if any of data is wrong it will get redirected
back to the login page and again ask for libraryid, username and password.
 Test for account creation- This form is used for new account creation when
student does not fill the form completely it asks again to fill the whole form
when he fill the form fully it gets redirected to page which show waiting for
conformation message as his data will be only added by administrator after
verification.
3. Test for teacher login module-
 Test for teacher login form- This form is used for logg in of teacher .In
this we enter the username and password if all these are correct teacher
login page will open other wise if any of data is wrong it will get
redirected back to the login page and again ask for username and
password.

Computer Science And Infomatics Page 85


Library Management System

INTEGRATION TESTING

In this type of testing we test various integration of the project module by providing the input
.The primary objective is to test the module interfaces in order to ensure that no errors are
occurring when one module invokes the other module.

Computer Science And Infomatics Page 86


Library Management System

CHAPTER 6
CONCLUSION & FUTURE SCOPE

This Application provides a computerized version of library management system which will
benefit the students as well as the staff of the library.
It makes entire process offline where student can search books, staff can generate reports and do
book transactions. It also has a facility for student login where student can login and can see
status of books issued as well request for book or give some suggestions. It has a facility of
teacher’s login where teachers can add lectures notes and also give necessary suggestion to
library and also add info about workshops or events happening in our college or nearby college
in the online notice board.

There is a future scope of this facility that many more features such as online lectures video
tutorials can be added by teachers as well as online assignments submission facility , a feature
Of group chat where students can discuss various issues of engineering can be added to this
project thus making it more interactive more user friendly and project which fulfills each users
need in the best way possible

Computer Science And Infomatics Page 87


Library Management System

CHAPTER 7
REFERENCES

 http://www.w3schools.com/html/html_intro.asp
 http://www.w3schools.com/css/css_background.asp
 http://www.w3schools.com/js/js_datatypes.asp
 http://www.w3schools.com/sql/sql_insert.asp
 http://www.w3schools.com/sql/sql_update.asp
 http://www.w3schools.com/php/php_forms.asp
 Fundamentals of software engineering by Rajib mall, PHIlearning
 Web development and application development by Ivan Byross BPB publications

Computer Science And Infomatics Page 88

Вам также может понравиться