You are on page 1of 53

GEETA INSTITUTE OF MANAGEMENT AND TECHNOLOGY

KURUKSHETRA

CANDIDATE’S DECLARATION
I hereby certify that the work which is being presented in the report entitled “Library
Management” in fulfillment of the requirement for the completion of Six Week Training in
Department of Computer Science & Engineering of Geeta Institute of Management and
Technology, Kanipla, Kurukshetra University, Kurukshetra, Haryana is an authentic record of
my own work carried out during industrial training.

Manisha Goyal
The industrial training viva-voce examination of Ms. Manisha Goyal (3612128) B.TECH
(3rdyear CSE) has been held on ________________.

Signature

Er. Kamali Gupta Er.Rahul Singla

(HOD CSE/IT DEPTT) (Head Corporate Links)

Er. Seema Sabharwal Er. Anurag Jain

(Training Coordinators) (Training Coordinators)

1
ACKNOWLEDGEMENT

The authors are highly grateful to Er. Raman Gupta Director/Principal, Geeta Institute of
Management and Technology, Kurukshetra for providing this opportunity to carry out the six
week practical training at C-DAC.

The authors are also highly grateful to Er. Deepali Gupta, Dean Academics, for her intellectual
support throughout the course of this work.
The constant guidance and encouragement received from Er. Kamali Gupta, HOD (CSE
,dept.),GIMT, Kurukshetra has been of great help in carrying out the project work and is
acknowledged with reverential thanks.
The authors would like to express a deep sense of gratitude and thanks profusely to Mr. Ajay
Modgil, Director/CEO of Company, without the wise counsel and able guidance, it would have
been impossible to complete the report in this manner.
The help rendered by Er. Rahul Singla, Head Corporate Links for experimentation is greatly
acknowledged.
The authors are also expresses their gratitude to other faculty members of Computer Science &
Engineering department of GIMT for their intellectual support throughout the course of this
work.
Finally, the authors are indebted to all whosoever have contributed in this report work and
friendly stay at GIMT Kanipla, Kurukshetra.

Manisha Goyal

2
ABSTRACT

This project library management is based on the management in java technology. Management is
everywhere in today’s life in real life examples in schools, colleges, in railway, in airway, in
railway. Management is required in library system. These project is based on the library
management system store the records of books and student in the database. We can perform
various kinds of operations in it. We perform operations like add, delete and update the data of
the library. In these we maintain all the records of books and all detail related to it. In it we save
the new book details, issuing book detail, return book detail and student details. We can easily
maintain, store, retrieve data in it. Similarly we can make management of others very easily. We
can easily maintain all records of the library.

3
Table of Contents

Candidate Declaration i
Acknowledgement ii Abstract
iii List of Figures
vi

1. Introduction to organization 1

1.1. About Company 1

1.1.1 Values 1

1.1.2 Vision and Strategies 2

1.1.3 Services Offered 2

1.1.4 Features of C-DAC 2

2. Introduction to project and project work 3

2.1 Introduction to Project 3

2.1.1. How to use 4

2.2Technology Used 4

4
2.2.1. Introduction to java. 4

2.3 Basic concept of object oriented programing 5

2.3.1. Objects 5

2.3.2 Classes 5

2.3.3 Data Abstraction 6

2.3.4 Inheritance 6

2.3.5 Polymorphism 6

2.4 Benefits of OOPS 7

2.5 What is eclipse? 8

2.6 System requirement specification 8

2.7 Hardware and software requirement 9

2.8 Analysis 10

2.8.1 Acceptance Cretaria 11

2.8.2 Data Collection 12

2.8.3 Preliminary Investigation 13

2.8.4 Identification of need 14

2.8.5 System Requirement Specification 15

2.9 Feasible study 15

2.9.1 Introduction of feasible study 15

2.9.2 Steps in feasible analysis 16

2.9.3 Types of feasibility 16

3. Results & Discussion 17

3.1 Result 17

3.2 Description 17

5
4. Conclusion & Future scope 21

4.1 Conclusion 21

4.2 Future Scope 21

References

Appendix

List of Figures

Figures No. Name Page No.


Fig 3.1 Login page 17

6
Fig 3.2 Issue of book page 17

Fig 3.3 Add student detail page 18

Fig 3.4 Search book page 18

Fig 3.5 Add book page 19

Fig 3.6 Search student detail page 19

Fig 3.7 Search issued book page 20

7
Chapter 1: Introduction to Organization

1.1 About Company


C-DAC centre for developing advance computing), Mohali was setup in May 1989. Primarily
with the mission to train manpower in electronic design & technology by offering a variety of
training programs in diverse aspects of electronics design, product development, production
technology, maintenance engineering, information technology and quality control, etc. In
December 2002, CEDTI Mohali merged with C-DAC with a primary mandate to promote high
end R&D along with training and education.
Centre continues to play a leading role in human resource development and training in
Information Technology (IT) sector in the northern region. Center offers high-end courses like
M.Tech in VLSI as well as ME in Electronic Product Design Technology (EPDT). Short term
value added courses and diploma are designed for knowledge based skill development. It also
offers courses for foreign participants, sponsored by MEA under ITEC/SCAAP programs.
C-DAC provides several courses in the field of advanced computing and software development.
Among these are the hpc certification course C-DAC Certified HPC Professional Certification
Programe (CCHPCP). CDAC organizes advanced computing diploma programmes through the
Advanced Computing Training School (ACTS) located all over India. The PG Diploma courses
include specialisations in Embedded System Design, VLSI, etc.
1.1.1 Values
People: -We care about people and the role of work in their lives. We respect people as
individuals, trusting them, supporting them, enabling them to achieve their aims in work and in
life. We help people develop their careers through planning, work, coaching and training. We
recognize everyone’s contribution to our success – our staff, our clients and our candidates. We
encourage and reward achievement.
Knowledge:- We share our knowledge, our expertise and our resources, so that everyone
understands what is important now and what’s happening next in the world of work – and knows

8
how best to respond. We actively listen and act upon this information to improve our
relationships, solutions and services. Based on our understanding of the world of work, we
actively pursue the development and adoption of the best practices worldwide.
Innovation:-We lead in the world of work. We dare to innovate, to pioneer and to evolve. We
never accept the status quo. We constantly challenge the norm to find new and better ways of
doing things. We thrive on our entrepreneurial spirit and speed of response; taking risks,
knowing that we will not always succeed, but never exposing our clients to risk.
Each specialist then cascades knowledge down to colleagues, so creating a matrix of skills and
expertise. This means that when clients contact C-DAC, they can immediately enjoy a
meaningful dialogue with any member of the team. The high level of ownership of client projects
at C-DAC produces astonishing levels of dedication and commitment to their success
1.1.2 Vision and Strategies
Our vision is to lead in the creation and delivery of innovative workforce solutions and services
that enable our clients to win in the changing world of work. Our professional collective has
expertise ranging from design to development. We combine this knowledge with proactive
thinking and strategic planning to approach new challenges with your overall business objectives
in mind. C-DAC management team brings together a wealth of experience in both technology
and organizational development that is critical in helping our customers achieve their goals and
ensuring that your design project or software development is planned and managed efficiently.
Thanks to a highly skilled and flexible team, C-DAC is in the position of providing services in
the following areas:
a) IT outsourcing and partnership possibilities
b) Web design & Web development
c) Software development & Testing
d) Recruitment & Staffing Solutions
e) Trainings & Placements
f) Android application/ game design and development
1.1.3 Services Offered
a) Health Informatics
b) Multilingual Technologies
c) Professional Electronics

9
d) Software Technologies
e) Cyber Forensics and Security
f) Multimedia Technologies
1.1.4 Features of C-DAC Technologies
a) Capability: Experience and innovation are key attributes of a worthy offshore provider.
C-DAC team possesses all that is needed for a successful development: technical capabilities,
creativity and experience with large and small projects.
b) Stability: C-DAC is a financially stable company with a seasoned leadership team, which
continues to strive for improvement of personal and professional skills and the quality of our
services.
c) Quality: We guarantee our customers will receive Creative and innovative designs and High
quality and bug-free Application Pages.
d) Dependability: We are committed to building steady, reliable long-term relations with our
customers. Sometimes this becomes rhetoric for an offshore provider; however we welcome you
to discuss how we achieve this. Contact us for a proof of how we go beyond the rhetoric and
stand by our customers.

10
Chapter 2: Introduction to Project and Project Work

2.1 Introduction to Project


The main purpose of the study is preparing a Java in approximate fulfillment of requirement for
“LIBRARY MANAGEMENT”.
The project has certain objectives. This project is basically for the users who want to develop
Java menu programs and building real life application.
The main objective of the project is to develop an application for the Bank with the help of
which we can store the library data, delete the extra record, update the data etc. It comprises a
Menu driven program and includes number of options and procedures for each selective method
with a complete class declaration of concept based on management.
The complete project handles one database within which we have the data of the library details.
This project includes number of frames.
This project is given to me to provide the scope of apply the concept of language. The library
needs to maintain the record of book issue and book return.
2.1.1 How to use
a) Firstly install JDK and eclipse in the system and install mysql workbench for database for
storing data in the database.
b) Make frames in eclipse and connect with the database.
c) Store particular information in the database and store all records of issuing, returning and
new books details in the library.
d) Apply various operations like deletion of data , modify of data ,store data etc are in the
database.
2.2 Technology Used
2.2.1 Introduction to Java
JAVA is high label language. It is also called an object-oriented programming language. JAVA
was developed by Bjarne Stroustrup at AT & A Bell Laboratories in Murray Hill, New Jersey,

11
USA in the early eighties. JAVA is an extension of C with a major addition of the class construct
to JAVA feature of Simular67.Since the class was a major addition to the original C language,
Stroustrup was called the new language C with classes. However later in 1983 the name was
changed to JAVA. The idea of JAVA comes from increment operator ++ thereby suggesting
that JAVA is incremented version of OAK.
The three most important facilities that JAVA adds on to other programming languages are
classes, function overloading and operator overloading. These features enable us to create
abstract data types, inherit properties form existing data types and support polymorphism thus
making JAVA a truly object-oriented language.
2.3 Basic Concepts Of Object-Oriented Programing
Object-oriented remains a term which is interpreted differently by different people. It is
necessary to understand some of the concepts uses extensively in object-oriented programming.
The following general concepts are:
a) Objects
b) Classes
c) Data abstraction
d) Data encapsulation
e) Inheritance
f) Polymorphism
2.3.1 Object
Objects are basic run-time entities in object-oriented system. They may represent a person, a
place, a bank account, a table of data or any item that the program must handle. They may also
represent user-defined data such as vectors, time and lists. Programming problem is analyzed in
terms that they match closely with the real-world objects.
When a program is executed the objects interact by sending message to one another. Example if
customer and account are two objects in a program then the customer object may send a message
to the account object requesting for the bank balance. Each object contains data and code to
manipulate the data. It represent them differently fig. Shows two notations that are popularly
used in object-oriented analysis and design.
2.3.2 Classes

12
Object contains data and code to manipulate that data. The entire set of data and code of an
object can be made a user-defined data type with the help of a class. In fact objects are variable
of type class .Once a class have been defined we can create any number of objects belonging to
that class. Each object is associated with the data of type class with which they are created. A
class is a collection of objects of similar type. For example box, control, details are member of
the class employee.
2.3.3 Data Abstraction and Encapsulation
The data and function into a single unit is called class is known as encapsulation. Data
encapsulation is the most striking feature of a class. The data is not accessible to the outside
world and only those functions which are wrapped in the class can access it. These functions
provide the interface between the object’s data and the program .This insulation of the data from
direct access by the program is called data hiding. Abstraction refers to the act of representing
essential features without including the background details or explanations. Classes use the
concept of abstraction and are defined as a list of abstract attributes such as size, weight and cost,
and functions to operate on these attributes. They encapsulate all the essential properties of the
objects that are to be created. Since the classes use the concept of data abstraction, they are
known as Abstract Data Types (ADT).
2.3.4 Inheritance
Inheritance is the process by which objects of one class acquire the properties of objects on
another class. In another ways, the mechanism of deriving a new class from an old one is called
inheritance. The old class is referred to as the base class and the new one is called the derived
class.
Types of Inheritance:
Single inheritance
Multilevel inheritance
S i n g l e i n h e r i t a n c e : A derived class with only one base class is called inheritance.
M u l t i l e v e l i n h e r i t a n c e : The mechanism of deriving a class form another derived class
is known as multilevel inheritance.
2.3.5 Polymorphism
Polymorphism is another important OOP concept. It means the ability to take more than one
form. For example an operation may exhibit different behavior in different instances. The

13
behavior depends upon the types of data used in the operation. Polymorphism plays an important
role in allowing objects having different internal structures to share the same external interface.
This means that a general class of operations may be accessed in the same manner even though
specific actions associated with each operation may differ.
2.4 Benefits Of OOPS
OOPS offers several benefits to both the program designer and the user. Object-orientation
contributes to the solution of many problems associated with the development and quality of
software products. The new technology promises greater productivity.
The principal advantages are:
Through inheritance we can eliminate redundant code and extend the user of existing classes. We
can build programs from the standard working modules that communicate with one another,
rather than having to start writing the code from scratch. This leads to saving of development
time and higher productivity. The principle of data hiding helps the programmer to build secure
programs that cannot be invaded by code in other parts of the program. It is possible to have
multiple instances of an object to co-exist without any interference. It is possible to map objects
in the problem domain to those objects in the program. It is easy to partition the work in a project
based on objects. The data-centered design approach enables us to capture more details of a
model in implement able form. Object-oriented systems can be easily upgraded from small to
large systems. Message passing techniques for communication between objects makes the
interface descriptions with external systems much simpler. Software complexity can be easily
managed.
2.5 What is Eclipse?
Android offers a custom plug-in for the Eclipse IDE, called Android Development Tools (ADT).
This plug-in is designed to give you a powerful, integrated environment in which to develop
Android apps. It extends the capabilities of Eclipse to let you quickly set up new Android
projects, build an app UI, debug your app, and export signed (or unsigned) app packages (APKs)
for distribution.
If you will be developing in Eclipse with the ADT Plug-in, first make sure that you have a
suitable version of Eclipse installed on your computer as described by the system requirements.

14
If you need to install Eclipse, you can download it from http://www.eclipse.org/downloads/. We
recommend the "Eclipse Classic" version. Otherwise, you should use a Java or RCP version of
Eclipse.

2.6 System Requirement Specification


The software requirement specification is produced at the cultimination of analysis task. The
function and performance allocated to software as part of system engineering are refined by
establishing a complete information description, detailed functional description, a representation
of system behavior, an indication of performance requirements and designed constraints,
appropriate validation criteria and other information pertinent to requirement.The software
requirement specification sates the goals and objectives of the software, describing it in the
context of the computer of the computer-based system.It is an agreement, a contract between the
client and developer on what the software product will do.
The basic issues which involves in this phase are: -
1 . F u n c t i o n a l r e q u i r e m e n t :- In this phase the First input is open new customer
record, list of customer, modify the account balance, delete the customer.
2. Performance requirements
a)Static requirement
It will support as many terminals as can be fitted in the matching environment static phase of
performance requirement is related to the capacity of the system.
b)Dynamic requirement
This strategy on strain on the execution behavior of the system. The response time of the output
after submitting the input is quit well. The speed is quit appreciable.
3. Design requirement
There are certain constraints, which restrict the choice for a design.
a)Standard Compliance
There are some standard, which must be followed during design of S/W. These are treated as
standard process.
b) H/W Limitations

15
It requires at least 40 MB of hard disk. Since the system is developed on MS-DOS platform
which requires very less configuration system. The system is design keeping in mind, that the
user does not need any hi-fi configuration.
c ) R e l i a b i l i t y a n d f a u l t t o l e r a n c e The system is reliable and there is no fault
consideration in the system.
d ) S e c u r i t y The system is having one security option i.e. it is password protected.
4.External interface requirements
There is no option for interaction with other S/W. But the interface of this system is quit
attractive. For H/W interface requirement the SRS must specify the logical characteristics of
each interface between S/W product and the H/W component.
On the above primary investigation the SRS maintained for the project is:-
The system should contain add menu to add customer record to the database tables.The system
should contain modify menu to modify existing customer’s record and update the database tables
accordingly. The system should contain delete menu to delete customer’s record from the
database when the customer closea the account. The system should contain search menu to
search customer’s record from the database on the specified condition as the use wants. The
search can be done on any field like name, account number etc. The system should contain entry
record menu to record customer’s entry time in the organization.

2.7 Hardware and Software Requirement


The system “LIBRARY MANAGEMENT” is an interactive environment, which requires up-to-
date hardware. Although the project does not require any specific and high-configured hardware
but having a good and high configured (if possible) hardware will overall improve the efficiency
of the work. The system works on a GUI environment so there is the need of a platform, which is
GUI in nature. Better to have windows Operating system.
So the hardware used for developing this system:
a) Pentium IV processor
b) 256 MB of RAM
c) A disk of capacity 80 GB.( or less)
Similarly the soft wares may be quoted as
1.Windows 2000 server Operating system.
2.Window version JDK (Java Development Kit)

16
3.Text Pad editor.

2.8 Analysis
System analysis is a process of gathering and interpreting facts, diagnosing problems and the
information to recommend improvements on the system. It is a problem solving activity that
requires intensive communication between the system users and system developers. System
analysis or study is an important phase of any system development process. The system is
studied to the minutest detail and analyzed. The system analyst plays the role of the interrogator
and dwells deep into the working of the present system. The system is viewed as a whole and the
input to the system are identified. The outputs from the organizations are traced to the various
processes. System analysis is concerned with becoming aware of the problem, identifying the
relevant and decisional variables, analyzing and synthesizing the various factors and determining
an optimal or at least a satisfactory solution or program of action. A detailed study of the process
must be made by various techniques like interviews, questionnaires etc. The data collected by
these sources must be scrutinized to arrive to a conclusion. The conclusion is an understanding of
how the system functions. This system is called the existing system. Now the existing system is
subjected to close study and problem areas are identified. The designer now functions as a
problem solver and tries to sort out the difficulties that the enterprise faces. The solutions are
given as proposals.
The proposal is then weighed with the existing system analytically and the best one is selected.
The proposal is presented to the user for an endorsement by the user. The proposal is reviewed
on user request and suitable changes are made. This is loop that ends as soon as the user is
satisfied with proposal. Preliminary study is the process of gathering and interpreting facts, using
the information for further studies on the system. Preliminary study is problem solving activity
that requires intensive communication between the system users and system

17
developers. It does various feasibility studies. In these studies a rough figure of the system
activities can be obtained, from which the decision about the strategies to be followed for
effective system study and analysis can be taken.
2.8.1 Acceptance Criteria
The following acceptance criteria were established for evaluation of the new system:
 The system developed should be accurate and hence reliable i.e. the error rate should be
minimized and the output should be accurate and consistent.
 It should satisfy the criteria specified in functional and performance requirements.
 The system should have scope to foresee modifications and enhancements i.e. it should be
able to cope up with changes.
 The system should have relatively independent and single function parts that can be put
together to make complete system.
 The development system should be such that the time and effort for program maintenance
enhancement is reduced.
 The system should operate well under normal peak and recovery conditions.
2.8.2 Data Collection
In order to create an informative and practical system, a system analyst would have to have some
kind of way to view the current system. Receiving feed back o what can be done to improve the
current system, and how much the current system I acceptable to the users. I had personally gone
and stayed there for sometime to outlook the current running system. I had also interviewed a
currently working librarian, the interview really gave me a picture of what was really happening
in the system and where some changes can be made. To get the exact and the most accurate and
the most accurate and correct information about the project and the requirement in it we also
took the help of a questionnaire. This helped us a lot, as by this method we were to get a lot of
information about the working of the project and the requirement of the users/client.
Questionnaire is the best means for getting the data from the user and that too with ease. The
data collected by this means is up to the mark and also there is no irrelevant or unusable data.
Questionnaire is also convenient way to get the data as the form is with the person and he can
answer the question whenever he has got time .These do not put a pressure on the person
answering because they have time to fill the form up whenever he/she has time, so, chances are
that data is accurate and exactly what is needed.

18
2.8.3 Preliminary Investigation
The data collection that occurs during preliminary investigation examines system feasibility. In this phase
several test is being made and the inference of these tests led to the conclusion that the system is feasible.
It is the collecting of information that helps committee members to evaluate the merits of the project
request and make an informed judgment about the feasibility of the proposed project. The first step in the
system development life cycle is the preliminary investigation to determine the feasibility of the
system.The purpose of the preliminary investigation is to evaluate project requests. It is the collecting of
information that help committee members to evaluate the merits of the project request and make an
informed judgment about feasibility of the proposed project.
Analysts working on the preliminary investigation should accomplish the following objective:
 Clarify and understand the project request.
 Determine the size of the project.
 Assess costs and benefits of alternative approaches.
 Determine the technical and operational feasibility of alternative approaches.
 Report the finding to management with recommendations outlining the acceptance or
rejection of the proposal.
2.8.4 Identification of need
A system analyst is person who conducts a study, identifies activities and objectives and
determines a procedure to achieve the objectives. Designing and implementing systems to suit
organizational needs are the functions of the system analyst. We play a major role in seeing
business benefit from computer technology.
The system analyst carries out the following job:
 The first and perhaps most difficult task of system analyst is problem definition.
 Initially a systems analyst does not know how to solve problem.
 Having gathered the data relating to a problem.
 System analysts coordinate the process of developing solutions.
System analysts are often referred to planners. An in the project title it is mentioned that the
system created will be banking system. This system will maintain information about the
customer of the bank. This system must contain add, modify, delete and search menus to add
new customer to database, modify certain updatable fields of customer and this updation must be
reflected in database permanently in the database, delete the customer record. The search for the
custimer can be done on any basis i.e. A/C number, name etc. The should system also generate
19
the print out pf every customer of the bank. So, this system will contain edit Menu, file menu,
view menu to add new customers data, to deposit the money, to delete the customer detail .
The system must check for the user error which can be generated frequently and provide an
interactive error information. The system must be user friendly so that user can interact with the
system easily and can get help through each step. So the system should have graphical user
interface.

2.8.5 System Requirement Specification


The software requirement specification is produced at the cultimination of analysis task. The
function and performance allocated to software as part of system engineering are refined by
establishing a complete information description, detailed functional description, a representation
of system behavior, an indication of performance requirements and designed constraints,
appropriate validation criteria and other information pertinent to requirement.
2.9 Feasible Study
2.9.1 Introduction of feasible study
Many feasibility studies are disillusioning for both users and analysts. First, the study often
presupposes that when the feasibility of a document is being prepared, the analyst is in a position
to evaluate solution. Second most studies tend to overlook the confusion inherent in system
development- the constraints and the assumed attitudes. If the feasibility study is to serve as a
decision document, it must answer three key questions:
Major findings and recommendations of the study. It is ideal for the user who requires quick
access to the results of the analysis of the system under study. Conclusions are stated, followed
by a list of the recommendations and a justification for them.
2.9.2 Steps In Feasibility Analysis
Eight steps are involved in the feasibility analysis, they are:-
 Form a project team and appoint a project leader.
 Prepare system flowcharts.
 Enumerate potential of the proposed system.
 Define and identify characteristics of the proposed system.

20
 Determine and evaluate performance and cost effectiveness of each proposed system
carefully.
 Weight system performance and cost data.
 Select the best-proposed system.
 Prepare and report final project directive for the management.

2.9.3 Type of Feasibilities:


Economic Feasibility
Economic analysis is the most frequently used technique for evaluating the effectiveness of a
proposed system. More commonly known as cost/benefit analysis; we in this procedure we
determine the benefits and savings that are expected from a proposed system and compare them
with costs. We found the benefits outweigh the costs; we take a decision to design and
implement the new proposed system.
This project had many specifications, so, it is also taken into consideration that it would take a
long time to make this project. The estimation I the form of brief points is discussed below in
brief:-
1) It would take about two months for the completion to the project.
2) It would take the efforts of two programmers in order to code the system.
3) It would take the efforts of a system analyst In order to analyze and design the system.
In developing the cost estimates for a system, we need to consider several cost elements.
Hardware costs relate to actual purchase or lease of the computer and peripherals, for example
printer, disk drive, tape unit, etc. This would mean that the company would need close to one
lakh o rupees to urn my system successfully and resourcefully gibing users plenty of computers
to do whatever personal department related activities they want.
In this much of money, we can also take a look at all the benefits that the company will be
granted due to the new system:
 Fast and easy access to all customer related procedures and functions.

21
 No need for large storage spaces the size of the room for storing file cabinets because of all
the information about the book is saved in the computer’s hard disk.
 High level of security and authentication of each and every user.
 No need for personnel, thus, no monthly salaries which leads to no extra funds.
 Reliability is increased, as backups of files and records can be made and saved in various
different locations and information will be highly secure , unlike in file cabinets where
entries can be easily be ripped or tampered with by users.
 The personal department will look much neater and cleaner giving the customers the
environment they need as there won’t be any cupboards or drawers that make the department
overcrowded.
 There will be no longer the need for all the paper work require to make timely reports on
inventory lists or other customers lists as the program generates them at anytime at a very
quick pace.
Technical Feasibility
This is concerned with specifying equipment and software that will successfully satisfy the user
requirement. The technical needs of the system may vary considerably, but might include:
The facility to produce outputs in a given time.
 Response time under certain conditions.
 Ability to process a certain volume o transaction at a particular speed. After examining
technical feasibility, we give more importance to the configuration of the system than the
actual make of hardware. The configuration gives the complete picture about the system’s
requirements:
Operational Feasibility
It is mainly related to human organizational and political aspects. The points to be considered
are:
 What changes will be brought with the system?
 What organizational structures are disturbed?
 What new skills will be required? Do the existing staff members have
Which skills?

22
Implementation of a new system affects both the technical side of the organization as well as the
social side. When we say “technical”, we mean, the available technology be enough to
implement system, or whether or not this technology will be worth it?
The system which is being designed by me, will be only require a computer and my software,
which is very easily available and in abundance. This will not pose problem to personal
department, as this department is part of a high credited institute which is very well exposed to
latest technology. When it comes down to costs of the technology needed, that it is not that much
of an issue to provide convenient funds to support it.
Training the staff and users o using the new system will not be difficult as the project designed is
very user friendly and every module present in it can be easily understood even to a lay man.
Accepting computers and the new system socially will not be a problem and will not be a down
point in implementing the new system.

Chapter 3: Results and Description

3.1 Result
Now days as we know that in every field there is requirement for the management in our schools,
Colleges, banks, railways, airway and everywhere. In the same way we need for management to
maintain the record of books issuing, returning, and adding new books details in library. So this
project fulfils all the necessary conditions to describe how a library management system works
how we can manage it.
3.2 Description
Here are the some of the figures about the library records pages.

Fig.3.1: Login Page


Fig.3.1: shows the login page which is used for register new entry and authenticate the existing
entry allow user to access library record.

23
Fig.3.2: Issue of book page
Fig.3.2 shows that these pages add delete and update data which book are issued to which
person means all details about issue of book details.

Fig.3.3: Add Student Detail Page


Fig.3.3 shows that these pages add update and delete student details to which the library books
has been issued.

24
Fig.3.4: Search Book Page
Fig.3.4 shows that these page search the book records that exists in the library.

Fig.3.5: Add Book Page


Fig.3.5 shows that this page will save the new book records in the library.

25
Fig.3.6: Search Student Detail Page
Fig.3.6 shows that this page will search the student detail according to their unique roll no.

Fig.3.7: Search Issued Book Page


Fig.3.7 shows that this page will search the entire data of issuing the particular book to particular
student according to their unique roll no.

26
Chapter 4: Conclusion & Future scope

4.1 Conclusion
Working on this project was quite difficult as even till date project is incomplete. I really enjoyed
this work because of following reasons:-
 I knew at the beginning of this project that it’s ambitious for me and chances for its success
are very low.
 Taking risk helped me to learn faster.
 Learned how media files work
4.2 Future scope
Some of the future improvements which we have thought of while developing this application
are as follows:
 Personalizing the application according to a user's preferences.
 Additional features can be added in it due to its low in size.

27
References

[1] http://www.caveofprograming.com

[2] http://www.javafreebooks.blogspot.com

[3] http://docs.oracle.com/javase/6/docs/api/

[4]http://java.sucess.blogspot.com

[5] The Java Tutorials: http://docs.oracle.com/javase/tutorial/

[6] Layout: http://developer.java.com/guide/topics/ui/declaring-layout.html

[7]Google Maps:http://code.google.com/java/add-ons/google-apis

28
Appendix

Main Java File:

importjava.io.File;
importjava.io.IOException;
importjava.util.ArrayList;
importjava.util.Date;
importjava.util.Random;
package P1;
import java.awt.*;
import java.awt.event.*;
import java.sql.Connection;

29
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class welcome extends Frame{
/**
*
*/
private static final long serialVersionUID = 1L;
String msg;
Button authenticateButton=new Button("Authenticate");
Button registerButton=new Button("Register");
Label label1=new Label("Username:",Label.LEFT);
Label label2=new Label("password:",Label.LEFT);
TextField userNameText=new TextField();
TextField passwordText=new TextField();
String userName = null,userPassword = null;
String s1,s2;
public welcome()
{
passwordText.setEchoChar('*');
addWindowListener(new myWindowAdapter());
setBackground(Color.white);
setForeground(Color.black);
setLayout(null);
add(authenticateButton);
add(registerButton);
setLayout(null);
add(authenticateButton);
add(registerButton);
add(label1);
add(label2);
add(userNameText);
add(passwordText);
label1.setBounds(25,65,90,20);
label2.setBounds(25,85,95,30);
userNameText.setBounds(150,65,170,20);

30
passwordText.setBounds(150,90,170,20);
authenticateButton.setBounds(100,150,90,30);
registerButton.setBounds(200,150,90,30);
setVisible(true);
setSize(350, 200);

registerButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
new register();
setVisible(false);
}
});

authenticateButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae)
{

setForeground(Color.red);
// int x=0;
s1=userNameText.getText();
s2=passwordText.getText();

Statement mystmt = null;


Connection con = null;
//System.out.println("You have entered the Name ::"+s1+"");
try
{
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost:3307/manu","root","root");
mystmt = con.createStatement();
//stmt.executeUpdate("insert into welcome values(null,'"+s1+"','"+s2+"','"+s3+"','"+s4+"','"+s5+"')");
String query="select userName,userPassword from userregister where userName='"+s1+"'";
ResultSet rs = mystmt.executeQuery(query);
while(rs.next())
{

31
userName = rs.getString("userName");
userPassword=rs.getString("userPassword");

}
if(userName.equals(userNameText.getText()) && userPassword.equals(passwordText.getText()))
{
System.out.println("You are logged in");
new front();
setVisible(false);

}
//System.out.println("user name is "+userName+" and password is "+userPassword);

catch(Exception ex)
{
System.out.println(ex);

if(mystmt != null)
try {
mystmt.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(con != null)
try {
con.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();

32
}

});
}
public static void main(String g[])
{
welcome f=new welcome();

f.addWindowListener( new WindowAdapter()


{
public void windowClosing( WindowEvent e )
{
System.exit( 0 );
}
} );
f.setSize( 350, 200 );

f.setTitle("User Login Form");


f.setVisible(true);
// f.show();
}

}
package P1;

import java.awt.*;
import java.awt.event.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class searchStudent extends Frame {
/**

33
*
*/
private static final long serialVersionUID = 1L;
String msg;
String sc;
String sa;
String sb;

Button searchButton=new Button("Search");


Button backButton=new Button("Back");

Label l1=new Label("Year:",Label.LEFT);


Label l2=new Label("Branch:",Label.LEFT);
Label l3=new Label("Name:",Label.LEFT);
Label l4=new Label("Rollno:",Label.LEFT);
Label l5=new Label("Depttname:",Label.LEFT);
Label l6=new Label("Enter RollNo to search record:",Label.LEFT);

TextField Year=new TextField();


TextField Branch=new TextField();
TextField nameText=new TextField();
TextField rollNumberText=new TextField();
TextField Depttname=new TextField();

TextField searchText=new TextField();

public searchStudent()
{addWindowListener(new myWindowAdapter());
setBackground(Color.pink);
setForeground(Color.blue);
setLayout(null);

add(l1);
add(l2);
add(l3);
add(l4);
add(l5);

34
add(l6);

add(searchButton);
add(backButton);

add(Year);
add(Branch);
add(Depttname);

add(nameText);
add(rollNumberText);

// b1.addActionListener(this);

l1.setBounds(25,65,90,20);
l2.setBounds(25,85,90,20);
l3.setBounds(25,105,90,20);
l4.setBounds(25,125,90,20);
l5.setBounds(25,145,90,20);
l6.setBounds(20,200,180,30);
add(searchText);

Depttname.setBounds(150,145,170,20);
Branch.setBounds(150,85,170,20);
Year.setBounds(150,65,170,20);

nameText.setBounds(150,105,170,20);
rollNumberText.setBounds(150,125,170,20);
searchText.setBounds(200,200,120,20);

searchButton.setBounds(150,250,50,30);
backButton.setBounds(200,250,50,30);

setVisible(true);

35
setSize(420,300);

searchButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
// System.out.println("hhhhh");

setForeground(Color.red);
// int x=0;

try
{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3307/manu","root","root");
Statement stmt = con.createStatement();
// stmt.executeUpdate("insert into register values(null,'"+s1+"','"+s2+"','"+s3+"','"+s4+"','"+s5+"')");
String query="select * from sdetail where Rollno='"+searchText.getText()+"'";
ResultSet rs = stmt.executeQuery(query);
String s1 = null,s2= null,s3= null,s4 = null,s5 = null;

while(rs.next())
{
//userName = rs.getString("userName");
s1=rs.getString("Year");
s2=rs.getString("Branch");
s3=rs.getString("Name");
s4=rs.getString("Rollno");
s5=rs.getString("Depttname");
}

Year.setText(s1);
Branch.setText(s2);
nameText.setText(s3);
rollNumberText.setText(s4);
Depttname.setText(s5);

36
}

catch(Exception ex)
{
System.out.println(ex);

}
});

backButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
new front();
setVisible(false);
}
});

}
public static void main(String g[])
{searchStudent stu=new searchStudent();
stu.setSize(new Dimension(420,300));
stu.setTitle("Search Student detail");
stu.setVisible(true);
}
}
package P1;
import java.awt.*;
import java.awt.event.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class SearchIssueBook extends Frame{

37
/**
*
*/
private static final long serialVersionUID = 1L;
String msg;
String sa;
String sb;
Button searchButton=new Button("Search");
Button backButton=new Button("Back");

Label l11=new Label("Enter student roll no to search",Label.CENTER);


Label l1=new Label("Name:",Label.LEFT);
Label l2=new Label("Rollno:",Label.LEFT);
Label l3=new Label("Sex(M/F):",Label.LEFT);
Label l4=new Label("Branch:",Label.LEFT);
Label l5=new Label("Phone:",Label.LEFT);
Label l6=new Label("Return_type:",Label.LEFT);
Label l7=new Label("Date of issuing:",Label.LEFT);

Label l8=new Label("Bookid:",Label.LEFT);


Label l9=new Label("Title:",Label.LEFT);
Label l10=new Label("Author:",Label.LEFT);
Label l15=new Label("YearPublished:",Label.LEFT);
Label l12=new Label("Publisher:",Label.LEFT);

TextField searchBookText=new TextField();


TextField nameText=new TextField();
TextField rollNoText=new TextField();
TextField dateOfIssueText=new TextField();
TextField branchText=new TextField();
TextField phoneText=new TextField();
TextField bookIDText=new TextField();
TextField titleText=new TextField();
TextField authorText=new TextField();
TextField publisherText=new TextField();

38
TextField yearPublishedText=new TextField();
TextField Sex=new TextField();
TextField Return_type=new TextField();

public SearchIssueBook()
{
addWindowListener(new myWindowAdapter());
setBackground(Color.white);
setForeground(Color.BLACK);
setLayout(null);

add(searchButton);
add(backButton);

add(l1);
add(l2);
add(l3);
add(l4);
add(l5);
add(l6);
add(l7);
add(l8);
add(l9);
add(l10);
add(l11);
add(l12);
add(l15);

add(searchBookText);
add(nameText);
add(rollNoText);
add(branchText);
add(phoneText);
add(dateOfIssueText);
add(bookIDText);
add(titleText);

39
add(authorText);
add(publisherText);
add(yearPublishedText);
add(Sex);
add(Return_type);
// b1.addActionListener(this);
l11.setBounds(35,40,200,20);
searchBookText.setBounds(300,40,100,20);
searchButton.setBounds(450,40,100,20);
l1.setBounds(35,65,90,20);
l2.setBounds(35,90,90,20);
l3.setBounds(35,115,90,20);
l4.setBounds(35,140,90,20);
l5.setBounds(35,165,90,20);
l6.setBounds(35,190,90,20);
l7.setBounds(35,225,90,20);
l8.setBounds(350,65,90,20);
l9.setBounds(350,90,90,20);
l10.setBounds(350,115,90,20);
l12.setBounds(350,140,90,20);
l15.setBounds(350,165,90,20);
nameText.setBounds(130,75,170,20);
rollNoText.setBounds(130,100,170,20);
branchText.setBounds(130,150,170,20);
phoneText.setBounds(130,175,170,20);
dateOfIssueText.setBounds(130,225,170,20);
bookIDText.setBounds(500,65,170,20);
titleText.setBounds(500,90,170,20);
authorText.setBounds(500,115,170,20);
publisherText.setBounds(500,140,170,20);
yearPublishedText.setBounds(500,165,170,20);
backButton.setBounds(280,250,50,30);
// l13.setBounds(,200)
Sex.setBounds(130,125,170,20);
Return_type.setBounds(130,200,170,20);
setVisible(true);
setSize(700, 300);

40
backButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
new front();
setVisible(false);
}
});

searchButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{

setForeground(Color.red);
// int x=0;

try
{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3307/manu","root","root");
Statement stmt = con.createStatement();
// stmt.executeUpdate("insert into issueb values(null,'"+s1+"','"+s2+"','"+s3+"','"+s4+"','"+s5+"')");
String query="select * from issueb where Rollno='"+searchBookText.getText()+"'";
ResultSet rs = stmt.executeQuery(query);
String s1 = null,s2= null,s3= null,s4 = null,s5 = null,s6= null,s7= null,s8= null,s9= null,s10= null,s11= null,s12=
null;

while(rs.next())
{
//userName = rs.getString("userName");
s1=rs.getString("name");
s2=rs.getString("Rollno");
s3=rs.getString("Sex");
s4=rs.getString("Branch");
s5=rs.getString("Phone");

41
s6=rs.getString("Return_type");
s7=rs.getString("Date_of_issuing");
s8=rs.getString("Bookid");
s9=rs.getString("Title");
s10=rs.getString("Author");
s11=rs.getString("Publisher");
s12=rs.getString("Yearpublished");

}
nameText.setText(s1);
rollNoText.setText(s2);
Sex.setText(s3);
branchText.setText(s4);
phoneText.setText(s5);
Return_type.setText(s6);
dateOfIssueText.setText(s7);
bookIDText.setText(s8);
titleText.setText(s9);
authorText.setText(s10);
publisherText.setText(s11);
yearPublishedText.setText(s12);
}

catch(Exception ex)
{
System.out.println(ex);

}
}
});
}
public static void main(String g[]){
SearchIssueBook stu=new SearchIssueBook();
stu.setSize(new Dimension(700,300));
stu.setTitle("Search Issued Book");
stu.setVisible(true);
}

42
}
package P1;
import java.awt.*;
import java.awt.event.*;
import java.awt.Label;
public class returnb extends Frame implements ActionListener{
/**
*
*/
private static final long serialVersionUID = 1L;
String msg;
Button b1=new Button("Ok");
Label l1=new Label("Refrence No.:",Label.LEFT);
Label l2=new Label("Password ID:",Label.LEFT);
Label l3=new Label("Sex(M/F):",Label.LEFT);
Label l4=new Label("Rollno:",Label.LEFT);
Label l5=new Label("Name:",Label.LEFT);
Label l6=new Label("Branch:",Label.LEFT);
Label l7=new Label("Return type:",Label.LEFT);
Label l8=new Label("Book id:",Label.LEFT);
Label l9=new Label("Title:",Label.LEFT);
Label l10=new Label("Author:",Label.LEFT);
Label l11=new Label("Category:",Label.LEFT);
Label l12=new Label("Phone:",Label.LEFT);
TextField t1=new TextField();
TextField t2=new TextField();
TextField t3=new TextField();
TextField t4=new TextField();
TextField t5=new TextField();
TextField t6=new TextField();
TextField t7=new TextField();
TextField t8=new TextField();
TextField t9=new TextField();
TextField t10=new TextField();
Choice c1=new Choice();
CheckboxGroup cbg=new CheckboxGroup();
Checkbox ck1=new Checkbox("Male",false,cbg);

43
Checkbox ck2=new Checkbox("Female",false,cbg);
Checkbox ck3=new Checkbox("forteen days",false,cbg);
Checkbox ck4=new Checkbox("sem",false,cbg);
public returnb()
{addWindowListener(new myWindowAdapter());
setBackground(Color.GRAY);
setForeground(Color.BLACK);
setLayout(null);
add(l1);
add(l2);
add(l3);
add(l4);
add(l5);
add(l6);
add(l7);
add(l8);
add(l9);
add(l10);
add(l11);
add(l12);
add(t1);
add(t2);
add(t3);
add(t4);
add(t5);
add(t6);
add(t7);
add(t8);
add(t9);
add(t10);
add(ck1);
add(ck2);
add(ck3);
add(ck4);
add(b1);
b1.addActionListener(this);
l1.setBounds(25,65,90,20);

44
l2.setBounds(25,90,90,20);
l3.setBounds(25,115,90,20);
l4.setBounds(25,140,90,20);
l5.setBounds(25,165,90,20);
l6.setBounds(25,190,90,20);
l7.setBounds(25,215,90,20);
l8.setBounds(25,240,90,20);
l9.setBounds(25,265,90,20);
l10.setBounds(25,290,90,20);
l11.setBounds(25,315,90,20);
l12.setBounds(25,340,90,20);
b1.setBounds(25,500,90,30);
t1.setBounds(120,65,170,20);
t2.setBounds(120,90,170,20);
t3.setBounds(120,140,170,20);
t4.setBounds(120,165,170,20);
t5.setBounds(120,190,170,20);
t6.setBounds(120,240,170,20);
t7.setBounds(120,265,170,20);
t8.setBounds(120,290,170,20);
t9.setBounds(120,315,170,20);
t10.setBounds(120,340,170,20);
ck1.setBounds(120,115,50,20);
ck2.setBounds(170,115,60,20);
ck3.setBounds(120,215,90,20);
ck4.setBounds(210,215,60,20);
setVisible(true);
setSize(400, 500);
}

public void actionPerformed(ActionEvent ae)


{if(ae.getActionCommand().equals("Ok"))
{msg="Book is return!";
setForeground(Color.red); }
}
public static void main(String g[])
{returnb stu=new returnb();

45
stu.setSize(new Dimension(500,500));
stu.setTitle("Return Book");
stu.setVisible(true);
}
}
package P1;
import java.awt.*;
import java.awt.event.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
public class issueb extends Frame{
/**
*
*/
private static final long serialVersionUID = 1L;
String msg;
String sa;
String sb;
Button submitButton=new Button("Submit");
Button backButton=new Button("Back");
Button updateButton=new Button("Update");
Button deleteButton=new Button("Delete");

Label l11=new Label("Student Details",Label.CENTER);


Label l1=new Label("Name:",Label.LEFT);
Label l2=new Label("Rollno:",Label.LEFT);
Label l3=new Label("Sex(M/F):",Label.LEFT);
Label l4=new Label("Branch:",Label.LEFT);
Label l5=new Label("Phone:",Label.LEFT);
Label l6=new Label("Return_type:",Label.LEFT);
Label l7=new Label("Date of issuing:",Label.LEFT);
Label l22=new Label("Book details",Label.CENTER);
Label l8=new Label("Bookid:",Label.LEFT);
Label l9=new Label("Title:",Label.LEFT);
Label l10=new Label("Author:",Label.LEFT);
Label l15=new Label("YearPublished:",Label.LEFT);

46
Label l12=new Label("Publisher:",Label.LEFT);
Label l13=new Label("Enter Book ID for Update or Delete :",Label.LEFT);
TextField searchBookText=new TextField();
TextField nameText=new TextField();
TextField rollNoText=new TextField();
TextField dateOfIssueText=new TextField();
TextField branchText=new TextField();
TextField phoneText=new TextField();
TextField bookIDText=new TextField();
TextField titleText=new TextField();
TextField authorText=new TextField();
TextField publisherText=new TextField();
TextField yearPublishedText=new TextField();
Choice Sex=new Choice();
Choice Return_type=new Choice();

public issueb()
{
addWindowListener(new myWindowAdapter());
setBackground(Color.white);
setForeground(Color.BLACK);
setLayout(null);
add(updateButton);
add(deleteButton);
add(l13);
add(searchBookText);
add(l1);
add(l2);
add(l3);
add(l4);
add(l5);
add(l6);
add(l7);
add(l8);
add(l9);
add(l10);
add(l11);

47
add(l12);
add(l15);
add(l22);
add(nameText);
add(rollNoText);
add(branchText);
add(phoneText);
add(dateOfIssueText);
add(bookIDText);
add(titleText);
add(authorText);
add(publisherText);
add(yearPublishedText);
add(Sex);
add(Return_type);
Sex.add("male");
Sex.add("female");
Return_type.add("forteen days");
Return_type.add("sem");
add(submitButton);
add(backButton);
// b1.addActionListener(this);

l11.setBounds(10,40,250,20);
l1.setBounds(25,65,90,20);
l2.setBounds(25,90,90,20);
l3.setBounds(25,115,90,20);
l4.setBounds(25,140,90,20);
l5.setBounds(25,165,90,20);
l6.setBounds(25,190,90,20);
l7.setBounds(25,215,90,20);
l22.setBounds(380,40,75,20);
l8.setBounds(350,65,90,20);
l9.setBounds(350,90,90,20);
l10.setBounds(350,115,90,20);
l12.setBounds(350,140,90,20);
l15.setBounds(350,165,90,20);

48
nameText.setBounds(120,65,170,20);
rollNoText.setBounds(120,90,170,20);
branchText.setBounds(120,140,170,20);
phoneText.setBounds(120,165,170,20);
dateOfIssueText.setBounds(120,215,170,20);
bookIDText.setBounds(500,65,170,20);
titleText.setBounds(500,90,170,20);
authorText.setBounds(500,115,170,20);
publisherText.setBounds(500,140,170,20);
yearPublishedText.setBounds(500,165,170,20);

updateButton.setBounds(400,250,80,30);
deleteButton.setBounds(280,250,80,30);

l13.setBounds(320,200,200,30);
searchBookText.setBounds(550,200,100,30);

submitButton.setBounds(200,250,50,30);
backButton.setBounds(500,250,50,30);
// l13.setBounds(,200)
Sex.setBounds(120,115,170,20);
Return_type.setBounds(120,190,170,20);
setVisible(true);
setSize(700, 300);

backButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
new front();
setVisible(false);
}
});

updateButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)

49
{
// System.out.println("hhhhh");

// msg="details submitted!";
setForeground(Color.red);
// int x=0;
String s1=nameText.getText();
String s2=rollNoText.getText();
String s3=branchText.getText();
String s4=phoneText.getText();
String s5=dateOfIssueText.getText();
// String s6=bookIDText.getText();
String s7=titleText.getText();
String s8=authorText.getText();
String s9=publisherText.getText();
String s10=yearPublishedText.getText();
//
System.out.println("hhh:::"+sa+"ttt:::"+sb+"jjj::"+s1+"ooo::"+s2+"iii:::"+s3+"yyy::"+s4+"rrrr:::"+s5+"jjj::"+s6+"oo
o::"+s7+"iii:::"+s8+"yyy::"+s9+"rrrr:::"+s10);
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3307/manu","root","root");
Statement stmt = con.createStatement();
// stmt.executeUpdate("insert into issueb values(null,'"+s1+"','"+s2+"','"+s3+"','"+s4+"','"+s5+"')");
String query="update issueb set
name='"+s1+"',Rollno='"+s2+"',Sex='"+sa+"',Branch='"+s3+"',Phone='"+s4+"',Return_type='"+sb+"',Date_of_issuin
g='"+s5+"',Title='"+s7+"',Author='"+s8+"',Publisher='"+s9+"',Yearpublished='"+s10+"' where
Bookid='"+searchBookText.getText()+"'";
stmt.executeUpdate(query);
System.out.println("Record Updated Successfully");
}

catch(Exception ex)
{
System.out.println(ex);

50
}
}
});

deleteButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
// System.out.println("hhhhh");

// msg="details submitted!";
setForeground(Color.red);

//
System.out.println("hhh:::"+sa+"ttt:::"+sb+"jjj::"+s1+"ooo::"+s2+"iii:::"+s3+"yyy::"+s4+"rrrr:::"+s5+"jjj::"+s6+"oo
o::"+s7+"iii:::"+s8+"yyy::"+s9+"rrrr:::"+s10);
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3307/manu","root","root");
Statement stmt = con.createStatement();

String query="delete from issueb where Bookid='"+searchBookText.getText()+"'";


stmt.executeUpdate(query);
System.out.println("Record Deleted Successfully");
}

catch(Exception ex)
{
System.out.println(ex);

}
}
});

submitButton.addActionListener(new ActionListener()
{

51
public void actionPerformed(ActionEvent e)
{
// System.out.println("hhhhh");

// msg="details submitted!";
setForeground(Color.red);
// int x=0;
String s1=nameText.getText();
String s2=rollNoText.getText();
String s3=branchText.getText();
String s4=phoneText.getText();
String s5=dateOfIssueText.getText();
String s6=bookIDText.getText();
String s7=titleText.getText();
String s8=authorText.getText();
String s9=publisherText.getText();
String s10=yearPublishedText.getText();
//
System.out.println("hhh:::"+sa+"ttt:::"+sb+"jjj::"+s1+"ooo::"+s2+"iii:::"+s3+"yyy::"+s4+"rrrr:::"+s5+"jjj::"+s6+"oo
o::"+s7+"iii:::"+s8+"yyy::"+s9+"rrrr:::"+s10);
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3307/manu","root","root");
Statement stmt = con.createStatement();
// stmt.executeUpdate("insert into issueb values(null,'"+s1+"','"+s2+"','"+s3+"','"+s4+"','"+s5+"')");
String query="insert into issueb
values('"+s1+"','"+s2+"','"+sa+"','"+s3+"','"+s4+"','"+sb+"','"+s5+"','"+s6+"','"+s7+"','"+s8+"','"+s9+"','"+s10+"') ";
stmt.executeUpdate(query);
System.out.println("Record Added Successfully");
}

catch(Exception ex)
{
System.out.println(ex);

52
}
});
Sex.addItemListener(new ItemListener()
{
public void itemStateChanged(ItemEvent ae){
sa= (String)ae.getItem();
System.out.println("hhh:::"+sa);
}
});
Return_type.addItemListener(new ItemListener()
{
public void itemStateChanged(ItemEvent ae){
sb= (String)ae.getItem();
System.out.println("hhh:::"+sb);
}
});
}

public static void main(String g[]){


issueb stu=new issueb();
stu.setSize(new Dimension(700,300));
stu.setTitle("Issue Book");
stu.setVisible(true);
}
}

53

You might also like