Library Management System Project Report
Library Management System Project Report
TABLE OF CONTENTS
Content Page No.
1. Declaration 3
2. Certificate 4
3. Acknowledgement 5
4. Abstract 6
5. Introduction of the Project 7
6. Objectives of the Project 8
7. Hardware and Software Requirements 9
8. Project Analysis & Designing 10
- DFD
- ER Diagram
9. Input / Output Screenshot 12
10. Coding 20
11. Testing 50
12. Future Scope 52
13. References 53
DECLARATION
I, Ashutosh, bearing roll number
201110106021, hereby declare that the work which is being
presented in the Minor Project, entitled "Library Management System" in partial
fulfillment
for award of Degree of "Bachelor of Computer Applications" in Department of
Computer
Application is submitted under the Guidance of
"Mr. Manoj Kumar".
I have not submitted the matter presented in this work anywhere for the award of
any other
Degree.
Date:
Student Name: Ashutosh
Roll No.:
201110106021
CERTIFICATE
Certified that the Project Report entitled "Library Management System"
submitted by
Ashutosh bearing roll no 201110106021 in partial fulfillment of the requirements
for the award
of the degree of Bachelor of Computer Applications is a record of the student's own
work carried
out under my supervision and guidance. To the best of our knowledge, this Minor
Project work
has not been submitted anywhere for the award of any other Degree.
It is further understood that by this certificate the undersigned does not endorser
approve of any
statement made, opinion expressed or conclusion drawn therein but approve Minor
Project for
the purpose for which it is submitted.
Mr. Manoj Kumar
Mr. Lalit Kumar
(Project-Coordinator)
(HOD, BCA Deptt.)
ACKNOWLEDGEMENT
Many people have supported me, in different ways, during the work with the minor
project. I'd
like to thank my guide Mr. Manoj Kumar & HOD Mr. Lalit Kumar for their kind and
active
support and valuable guidance during the work process. My family has, as always,
offered me
their unconditional support, during my efforts in completing this Minor Project.
However, it would not have been possible without the kind support of many
individuals and
institution.
I would like to extend my sincere thanks to each and every member related to MIT
(PC).
Student Name : Ashutosh
BCA Vth Sem
Roll No. :
201110106021
ABSTRACT
Online Library Management System is a system which maintains the information
about the books present in the library, their authors, the members of library to
whom
books are issued and all. This is very difficult to organize manually. Maintenance
of
all this information manually is a very complex task. Owing to the advancement of
technology, organization of an Online Library becomes much simpler. The Online
Library Management has been designed to computerize and automate the operations
performed over the information about the members, book issues and returns and all
other operations. This computerization of library helps in many instances of its
maintenance. It reduces the workload of management as most of the manual work
done is reduced.
INTRODUCTION
The project "Library Management System" is developed in Java with the help of
AWT and Swing packages , which mainly focuses on basic operations in a library like
adding new member, new books, and updating new information books and
members and facility to issue and return books. Using this application librarian
can
issue and return books easily also with this user can add new books easily.
This System application is reduced as much as possible to avoid errors while
entering data. It
also provides an error message while entering invalid data. It is user-friendly as
no formal
knowledge is required to use the system.
The software keeps track of all the information about the books in the library,
their cost, their
complete details and total number of books available in the Library. The user will
find it easy in
this automated system rather than using the manual writing system. The system
contains a
database where all the information will be stored safely. The system is user-
friendly and error
free.
ERD
it,imk; Ad min
C
Fig . Library Management System
SCREENSHOTS
Home page :-
This is the home page of the library management system . There are two sections:
Admin login
and Librarian login.
Login page
Library Management
Admin Login
(Login
Librarian Login
Login
Admin Login
After clicking on admin login the following window opens which ask name of admin
and
password of admin.
Admin Login page
— ❑ X
Admin Login
Name
admin
Password
Login
Cancel
Admin Section
After login with correct details the admin section open there are different option
for admin which
includes :-
[Link] Info -> Add Librarian
2. View Info -> View Librarian
3. Delete Info -> Delete Librarian
4. Exit -> Logout
LAL Admin Section
— ❑ X
Add Info View Info Delete Info Exit
Add Librarian
By clicking on Add Info admin can add a new Librarian by filling this information.
114 Add Librarian
0 X
Add Librarian
Name
Arun
Password
E-mail
arun@[Link]
Contact
4578121212
kddress
10, XYZ colony
City
Meerut , UP
Add Librarian
Cancel
View Librarian Information
If admin successfully add librarian with correct details .admin can see all the
librarian by
clicking on View Info.
111.. Librarian Information
❑ X
ID
Name password E-mail Contact Address
City
1
Kapi I pass123 [email protected]
10,X Street2 Col... Meerut
2
Anoop pass123 [email protected]
11,X Street,Z Col... Meerut
5
Arun pass123 arung123grnail.c...4578121212 10,
XYZ colony Meerut , UP
1
Delete Librarian
I Delete
View Librarian Information
After successfully deleting the librarian the View Info window automatically open
and show the
current librarian.
Libman Information
❑ X
Librarian Login
In the home page if you click on librarian login the following window opens . Here
librarians can
login with a name and password which is set by the admin.
Librarian Login, page
0
Librarian Login
kapil
"
s's's
Cancel
Librarian Section
After successfully entering the data librarian section open . Here librarian can
perform different
task like :-
[Link] Info -> Add Books
n Section -
A
dd Info View Info Issue Info R eturn Exit
111
ifitA
M\ L\
I
N
- -
Add Book
Librarians can add book by clicking on Add Info and filling the following details .
Add Book
❑ X
Add Book
Book No
6
Book Name
java
Author
E balaguru swami
Publisher
BP publications
Quantity
Librarian can see the available books by clicking on View Info -> View Books
VPEW Book Information
❑ X
Issue Book
Librarians can issue the books by clicking on Issue Info and provide this
information .
1=1 Issue Book Section
0 X
Issue Book
Book Id
I
Book No
6
Book Name
java
Student Id
21
Student Name
Ashutosh
Student Contact
763847111
Book Quantity
50
Issue Book
Cancel
View Book Information
Librarians can view book by clicking on View Issue Book.
Return Book
Librarians return the issue book by clicking on Return Info and provide the
following
information.
I Return Book
❑ X
Return Book
I
-Book No
6
!Student Id
21
CODING
In this project there are classes used which perform different functions.
1. [Link]
package Library;
import [Link].*;1
public class ConnectionClass
Connection con;
Statement stn;
ConnectionClass()
try
[Link]{"[Link]");
con=[Link]("jdbc:mysql://localhost:3306/
Library","root","pass123");
stmcon..createStatement();
if([Link]())
[Link]("Not Connect");
else
Sys-t4mn .[Link]("Connect");
catch( Exception e)11
[Link]();
public static void main(StringEl args)
new ConnectionClass();
}
[Link]
2 package Library;
3 v import [Link].*;
4 import [Link].1;
5 import [Link].*;
6 v public class Index
extends 'Frame implements ActionListenert
7 Rabe]. 11,12,13314;
Button bt1,bt2;
9 ]Panel p102„p3;
10 Font f,f1;
Ll
12 v Index()
13 sup
."("Login page—;
14
setLocaticmC400,200.1;
15
setSize%500,200);
16
17 f=neu Font "Aria1'„[Link],25);
18 f1iew Font"Arial",[Link],20);
19 11=new habelrAdmin Login");
20 12=new habel("Librarian Login");
21 13=new habelj"Library Management");
22 btl=new ButtonffLoginm);
23 ht2=ney Button."Login");
24 Ibti.addActionListeneri7ris);
25 [Link].—:: ;
26
27 ImageIcon img = nev;
[Link]("icon/[Link]"));
28 Image
i=[Link] .get5caledInstance'130,120,Image.51ALLDEFAULT
;
29 ImageIcon img2=new Imagelcomi.;
39 ]A=new hatie1dmg2:;
31
32 [Link].f1;.;
33 [Link]•F1.;
34 [Link].f;;
35 titi.setFontj1.;
36' tit2.setFontj1.;
37
38 [Link]);
39 [Link]([Link]);
AO [Link]([Link]);
41 [Link]([Link]
42 [Link]{[Link]
;
43 [Link]([Link]
;
44
45 pl=new ]Panel;;;
46 [Link]
6ridLayout(2,2,10,10));
47 [Link] 11:;
48 [Link] btli;
49 [Link] 12';
50 [Link] bt2,;
51
52 p2=new ]Panel.
53 [Link] 6ridLayout(1,1,10,10)
;
54 [Link].14:;1
55
56 p3=new 3Panel,
,;
57
[Link] new 6ridLayout(1,1,10,10)
58
[Link]([Link]);
59 [Link] L3 ;
60
61
62
setLayout(new BorderLayout(10,10) ;
63
addp3,"North"
64 add:;
;2,"West":;
65
addp1,"Center");
66
67
68
69 public
void actionPerformed(ActionEvent e)
70 f
71 if
e.get5ource()==btl)
72
73 [Link]("Admin login");
74 new Admin().setVisible(true);
75 [Link](i.31se);
76 }
77 W e.get5ource()==bt2,
78
79 [Link]("librarian login");
80
81 new Librarian().setVisible(true);
82 [Link]( :else);
83
84
85
86
87
88 public static void main(String[] args)C
89 new Index().setVisibletrue);
90 }
91 )
92
93
4. [Link]
41 [Link](Color.dark6ray);
42 [Link](Color.dark8ray);
43
44 pl=new
]Panel();
45
[Link] GridLayout(1,1,10,10)};
46 [Link](11);
47
[Link]([Link]);
48 p2 ew
3Pane1();
49
[Link](new 6ridLayout(3,2,10,10));
50 [Link] 12);
51 [Link] tfl);
52 [Link] 73
;
53 [Link]:sof1);
54 [Link](bt1);
55 [Link] (bt2);
56
57 setLayout•new BorderLayout(10,10):;
58 add p1,11orth"h1
59 add p2,"Center");
69 }
61 public void actionPerformed(ActionEvent e)
62
63 String [Link]();
64 String pass=[Link];
65
66 if(e.get5ource()==bt
67
fO try
69
79 Connectiontlass obj=new Connectiontlass();
71 String s-'select username,password from adnin where
username=—+nane."' and password=—+pass+ — ;
72 Result5et rest=[Link](s);
73 if(rest.next0)
74
75
[Link] Section";;
76 new
[Link](true);
77 [Link]'alse ;
78
79 else
SO
sl M
[Link](null,"drung-);
92 this-setVisible
93 this-setVisible [Link]);
94 }
95
96 catch(Exception ee)
97
B8 [Link]();
89 }
90
91
92 if.:[Link]()==bt2)
93
94 [Link](false);
95 }
96
97
98
99
Ise public static void main(String[] arg )f_
221 new Admin().setVisible<true);
102
1E13
104
105
5. AdminSection.j ava
6 public class AdminSection
extends ]Frame implements ActionListenerf
7 3Labe1 11;
8 ]Panel pl,p2;
9 Font f,f1;
10 AdminSection()
11
12 super("Admin Section");
setLocation(0,0);
14 setSize(1500,800);
15 f=new Fonti„"Aria1",Font.0010,25);
16 fl=new Font("Arial"„[Link],20);
17 ImageIcon lug
= new [Link] [Link];
18
Image i=[Link]. .getScaledInstance(1500,800,[Link] DEFAULT);
19 ImageIcom img2=new ImageIcon
i ;
20 11=new Label img2,;
21 )Menular ml=new
JMenuBar ;
22 }Menu menl=new Mienu("Add Info");
23
)MenuItem mentl=new MienuIteC"Add Librarian");
24 ]Menu men2=new Menu,"View Info");
25
JMenuItem ment2=new MienuIteC"View Librarian");
26 ]Menu men3=new Menui"Delete Info");
27
JMenuItem ment3=new MienuItem("Delete Librarian");
28 ]Menu men4=new Menu,'"Exit");
29 ]MenuItem
ment4=new ]MenuItemMogout");
30 [Link](mentf,;
31 men2.addment2',;
32 [Link].ment3',;
33 men4.addOment4.,;
34 [Link];
35 [Link];
36 ml.addmen3 ;
37 ml.addCmen4 ;
38 [Link](.f);
39 [Link]..f);
40 [Link](f);
41 [Link](f);
42 [Link]);
43 [Link](f);
44 [Link](f);
45 [Link]-F:;
46 [Link](this);
47 [Link](this);
48 [Link](this);
49 [Link](this);
50 set]MenuBarfml.;;
51 addA.1
52
53
54 public void ac tionPerformed(ActionEvent e)
55
56 String [Link]();
57 if([Link]("Add Librarian")1
56
59 [Link]("Add");
'60 new AddLibrarian().setVisible(true);
'61
62 else if([Link]("View Librarian"))
63
64 [Link](Niewl;
65 new ViewLibrarian().setVisible(true);
66 it
67 else [Link]("Delete Librarian")}
68
69 [Link]("Deleter);
70 new DeleteLibrarian().setVisible(true);
72
72 else [Link]("Logout"))
/3
74 [Link]("logowt");
75 [Link](0);
76 1
77
78
79
BO public static void main(String[] ergs) L
81 new AdminSectioW)..setVisible(true};
B2 I51
83
6. [Link]
1 package Library;
2 import [Link].*;
3 import [Link]..*;
4 import [Link].*;
5
6 public class AddLibrarian -.tends
]Frame implements ActionListeneri
7 Rabel 11,12,13,14,15,16,17;
8 ]TextField tfl,tf3,t-f4,tf5,tf6;
9 Passwordfield pf2;
10 Panel pljp2;
11 ]Button trtl,bt2;
12 Font f,f1;
13
14 AddLibrarian()
33
16 superl."Add Librarian");
17 setLocationi4400,2001;
18 setSiz&,650,4400i;
19 f=new
FontrArial"„font.600225);
20 f1=new
font("Aria1",forft.8O1.0,20);
21 11
ew JiabelrAdd Librarian');
12 ew JLabelrName"J;
23 13=nei
Rabel('Passward");
24 14=new Label("E-mail");
25 15=new Label("Contact".q.
26 16=new Label("Address"
;
27 17=new Rabel("City");
28 bti=new Button("Add
Librarian")i
29 bt2=new Button("Cancelm);
30 tfl=new HertField();
31 pf2=new PasswordField
32 tf3=new HertField();
33 tf4=new iTertField0;
34 tf5=new HertField();
35 tf6=new iTextFie/d();
36
37 [Link](f);
38 [Link](f1);
39 [Link]'fl:;
40 [Link]'fl];
41 [Link] fl.;
42 [Link] fl.;
43 [Link] fl
44 [Link] ;
45 [Link]:f1 ;
46 [Link] fl ;
47 [Link] fl ;
48 [Link] fl ;
49 [Link] fl ;
50 [Link] fl ;
51 [Link] fl ;
52 [Link],tnis);
53 [Link]•this);
54 [Link]([Link]).;
55 [Link]);
56
57 pl=new Panel. ;
58 [Link]
6ridlayout(1,1,10,10));
59 [Link] 11 ;
60
[Link]([Link]);
61 p2=new Panel ;
62 [Link]
5ridlayout(7,2,10,10));
63 [Link] 12 ;
64 [Link] tfl
65 [Link] 13 ;
66 [Link] oft ;
67 [Link] 14 ;
68 [Link] tf3 ;
69 [Link] 15 ;
70 [Link] tf4 ;
71 p2.addk16';
72 [Link](tf5);
73 [Link](17);.
74 [Link](tf6);
75 [Link](btl);
75 [Link] ;
76 [Link].6t2.;
77
78
setLayoutknew BorderLayout(10,10) ;
79 add pl,"North" ;
80 add
p2,"Center");
82
E3 public
void actionPerformed(ActianEvent e)
84
85 String
name=[Link] ;
E6 String
pass=[Link] ;
87 String
email=[Link]);
88 String
contact=[Link]
89 String
[Link]();.
90 String
city=[Link]};
91
92
if,;[Link]()==bti)
93
94 try 5
99
ConnectionClass obj=new ConnectionClassC);
96
String q="insert into librarian(Neme,Password,Email,Cnntact,Address,Citv)
values('"
97
i-name+—,'"+pass-9--,'"+email+—,'"4-contact+—,'"A-add+—,'"A-city±—)";
98
int aa=[Link](q.);
99 if(aa==1)
lag
101
30ptionPane.showoMessageDialognJ11,"Inserted Succesfully");
182
183 1
104 else
105 {
183
[Link](null,-Something Wrong I!! Insert data Correctly ");
187
this..setVisible'7
188
109
110
111
catch(Exception ee)[
112
[Link]();
112
[Link]();
113
114
115
11.6 if-([Link]()==bt2)
117
11'a -1-!- —setVisible(1=alse);
119
120
121
122 public s:tatic void main(Strings) args)c
123 new AddLibrarian().setVisible;true,;
124
125
126
7. View [Link]
1 :)ackage Library;
2 import [Link]..*;
3 import [Link].*;
4 import [Link]..*;
5
6 public class ViewLitorarian extends ]Frame
{
7
String x(]=r1D","Name",npassword","E-mail"„"Contact","Address","City"T;
]Button hts,
0 String y[][]=new String[20][7];
10 int i=0,j=0;
11 ]Table t;
12 Font f,f1;
13 ViewLibrariane,
14 {
15 super("Librarian Information");
16 setlacation(50,78);
17 setSize(1808,400);
la f=new Font 'Arial",font.BOL6,15);
19 try
20
21 ConnectionClass
obj=new ConnectionClass();
22 String ci="select * from Librarian";
23 ResultSet rest
=[Link](q);
24 while([Link]())
25
26 y[i][j++]=rest .getString("id");
27 yEii[j++]
=rest .getString("Hame");
28 YLini+
+]=rest .getString("Password");.
29 y[i][j+
+]=rest .getString("Email");
38 y[i][j++]
=rest .getString("contact");
31 y[i][j+
+]=rest .getString("Address");
31 y[i][j+
+]=rest .getString("City");
33 i++;
3.1 jai
35 }
36 t=new iTable(y,x);
37 [Link](f);
38
tatch(Exc ption ex)
40
41 [Link]();
42
43 ]ScrollPane sp=iew 3ScrollPane t
44 add(s0;
45
46 public static void
main(StringE. args)=
47 new ViewLibrarian().setVisible
43
443 }
50
8. [Link]
1 package
Library;
2 impart
[Link].*;
3 Import
[Link].*;
4 import
lavaxmswing.*;
import java.sql_*;
6
7 public
class DeleteLibrarian extends 3Frame implements ActionListeneri
8
String x[]4"11:1","Name","password",mE-mail","Contact","Address","Cityml;
10 Mutton
btl;
11
String y[][]=new String[20][7];
12 int
i=0,j=0;
13 :Label
11;
14 Tfable
t;
15 Font
f,f1;
16
7TextField tf1;
17 :Panel
pl.;
18
DeleteLibrarian()
19
20
super("Delete Librarian information");
21
setLocation■50,701;
22
setSizej000,400:;
23 f=new
Fon-WrAria1",[Link],15);
24 try
25 {
26
ConnectionClass Dbj=new ConnectionClass();
27 String
q="select * from Librarian";
23
ResultSet rest =[Link](q);
29
while(restmnext())
36 {
31 y[i][j+
+]=rest .getString("id');
32 y[i][j+
+]=rest .getStringOlame");
33 y[i][j+
+]=rest .getString("Password");
34 y[i][j+
+]=rest .getString("Email");
19 y[i][j+
+]=rest .getString("contact");
36 y[i][j+
+]=rest .getString("Address");
37 y[i][j+
+]=rest .getString("City");
38 i++;
39
40
41
42 t=new ]Table(y,x);
43 [Link](f);
44
45
45 catch(Exception ex.
47
48 [Link]();
49
50
51 3ScrollPune sp=new JScrollPanetJ;
52
53 11=new JLabel("Delete Librarian":;
54 tfl=new 31extField(
55 trtl=new 3Buttoni"Delete");
56 [Link](this ;
57 11..setFont.:f);
58 [Link](f ;
59 [Link](f
60 pl=new Wanel:,;
61 pl...setlayoutinew GridLayout(1,3,10,10)';
62 [Link]'11.;
63 [Link]);
64 pl.addJrt1);
65
66 setLayoutfnew BorderLayout(10,10));
67 add sp,"Center");
68 add p1,"South");
69 [Link].;
70
71
72 public void actionPerformedlActionEvent e)
73
74 if(e.get3ource()=1:rt1)
75 !:
67 adcRsp,"Ceater");
68 add(p1,"5outh");
69 adcKsp);
70 }
71
72 public void actionPerforned(ActionEvent e)
73
74 [Link]()==bti)
75
76 int id=[Link]([Link]());
77 try
78
79 ConneetionClass obj=new Connectiontlass();
80 String q="delete fror Librarian where id='"+id+"'";
81 int res=[Link](q);
82 if(res==1)
83
84 [Link]:.null,"Sucessfully Deleted");
85 [Link]);
86 new [Link](true);
87 1
88 else
89
90 [Link](null,"Something Wrong I!! Please Try
Again");
91 [Link]);
91 new DeleteLibrarian().setVisible(true);
93 1
94 1
95 catch(Exception ex)
96
97 [Link] ;
93
99
100 1
101
102 public static vaid maine,StringE] ergs)
103 new Deletelibrariam).setVisible(true);
1014
9. Librarian.j ava
13 panic class Librarian extends ]Frame implements
ActionListener{
14 Rabe' 11,12,13;
15 Button btlibt2;
16 Panel pl,p2;
17 llertField tfl;
16 Passwordfiell pf1;
19 Font f,f1;
20 Librarian()
21
22 suiper("Librarian Login
page");
23 setalcation 400,200);
24 setSize 500,200);
25 f=new
FontC"Arial",[Link],25 ;
26 fl=new Font
"Aria1',[Link],201;
27 11=new habel("Librarian
Login");
28 12=new habell'Hame");
29 13=new habel?"Passuord");
30 btl=new Button"Login");
31 bt2=new Button"Cance1"1;
32 [Link].7±:.
;
33 [Link]
-' 1.
34 tfl=new 3TextField
35 pfl=new Passwordfield
;
36 [Link] f
37 [Link] -F1.;
38 [Link] fl.;
39 [Link] fl
40 [Link]
41 [Link] fl);
42 [Link].11);
43
44
[Link]);
45 [Link]);
46
[Link]);
47
[Link](Color.dark6ray);
48 pl=nepi Panell);
49
[Link]-Lnew EridLayout(1,1,10,10):;
50 [Link].11:;
52 pl.set3ackground(Color.8LUE);
52 p2=new ]Panel(];
53 [Link](new 6ridLayout(3,2,18,10) ;
54 p2.adel2);
55 [Link](tf1);
56 p2.ade13);
57 [Link](pf1);
58 [Link](bt1);
59 [Link](bt2);
60 setLayout!new BorderLayout(10,10):;
61 add,p1,"North—,.;
62 add,p2..."Center");
63
64 public void actionPerformed(ActionEvent e)
65
66 String name=[Link]();
67 String pass=[Link]();
68
69 if([Link]()==btl)
70
71 try
72
71 ConnectionClass obj=new Connectiontlass();
74 String s="select name,password from Librarian where name='"+name+"'
and password='"+pass÷"'";
75 ResultSet rest=[Link](s);
76 if([Link](l)
77
78 [Link]("Librarian Section");
79 new LibrarianSection().setVisible{true);
80 [Link](false);
81 }
82 else
83
84 [Link](null,"Wrong");
85 [Link] e:;
86 [Link](true);
87
82 else
33
84
[Link],"Wrung");
85 thil .setVisible false);
86 th.1]..setVisitple true);
87
88 }
89 catch(ExceptioP ee)
90
91 [Link]
I;
92 }
93
94
95 if([Link]()==bt2)
96
97 [Link](false);
98
99
100 public static void main(String[] arg ){
lal new Librarian().setVisible(true);
182
103
104
105
44 [Link] f
;
45 [Link] f
;
46 [Link] f
;
47 [Link] f
;
4B [Link] f.;
49 [Link] f.;
50 [Link] f
;
51 [Link]);
52 [Link]);
Si [Link] W
f);
54
[Link](this);
55
[Link](this);
56
[Link](this);
57
[Link](this);
58
[Link](this);
59
[Link](this);
60 setlMenuBar;m1!;
61 adddl:;
62
63
64 public void actionPerformed(ActionEvent e)
65
66 String [Link]();
67 if([Link]("Add Book"))
68
69 [Link]("Add");
70 new AddBook().setVisible(true);
71 )
72 else if([Link]("Viely Book")}
73
74 [Link]("View Info");
75 new ViewInfo().setVisible(true);
76
77 else if([Link]("View Issue Book"))
75'
79 [Link]("View Issue Borfgrok");
84 new ViewIssueaook().setVisible(true);
80 new
ViewIssueBook().setVisible,(true);
81 )
82 else if([Link]("Issue
Book"))
83
84 [Link]("Issue
Book");
85 new
IssueBook().setVisible(true);
86
87 else [Link]/s("Return
Book-))
88
89 [Link]("geturn
Book");
90 new
ReturnBook().setVisible(true);
gl )
92 else if([Link] M
ogout
93
94 [Link].print1 W
logout");
95 [Link](0);
96' )
37
98 public static void mainI,StringE argsg
99 new LibrarianSection
seirsasibletrue:;
mola
181 I
102
41
[Link] f1
42
[Link] f1 ;
43
[Link] fl %;
44
bt2.setFontf1:;;
45
[Link] :his);
46
[Link] 71,is);
47
11.setHorizonta1llignmentC][Link]);
4#1
[Link] ;
49
pl=new Wanelf);
50
[Link] new GridLayout(1,1,10,10));
51
pl.addA1;;
52
p1.set8ackground([Link],;
53 p2=ftew
]Panel);;
54
p2..setLayout.'new .GridLayout(6,2,10,10)",;
55 [Link]
12 ;
56
[Link] tfl ;
57 [Link]
13';
58
[Link] tf2.;
59 [Link]
14 ;
60
[Link]:tf3,;
61 [Link]
15.;
62
[Link] tf4:;
'63 [Link]
16 ;
'64
[Link](tf5).;
65
p2..add(bt1);
66
[Link].2);,
67
setLayout(new Borderi_ayout(10,10));
68
addi.p1,11orth"};
69
addip2,"Center'J;
70 }
71
public void actionPerformed(ActionEvent
72
73 String Book Nb=[Link], i;
74 String Book Mame=[Link]
75 String Author=[Link]'.;
76 String Publisher=[Link]
77 String Quantity=tf5..getText ;
78 String Date-new [Link]-Date .toStringi.,5
79
SU if([Link]()--btl)
81
82 tryA
03. ConnectionClass obj-ne6 ConnectionClass();
84 String q--insert into Add Book(Book No,Book
Name,A6thor,Publisher..[Link]) yalues(.-
85 Book
86 int aa-obj_stm_ejtecotellpdate(q);
87 iffaa--1)
88
89 [Link](o 11.-Inserted
Succestully-);
40 [Link][false);
41
42 else
49
94 [Link] 11.-Sramething Wrong L!I
Insert data Correctly
95 [Link](true);
96
97
94
44 catch(Exception ee)
100
101 er.print5tackTroce{);
102
103
184 11 -(e.get5onrce()=-6t2)
105
106 this_setVisible(false);
107
108
109 1
110
111 public static void
nain(String[] nc85){
112 new
AddBook().setVisible(troe);
114 1
12. [Link]
b public class ViewInfu extend=_ ]Frame
String x[] {"Irj'hicilt
Nce,'"6bak_N4me"j'Auturn,"Quantity","Issue beak","batell
Mirttam bt;
String y[][[Link] String[a][R];
ie int i=81,j41;
u ]Table ti
Lt Font f,f1;
LS
L4 Viewlirfa()
13
it super("Idow Doak Enfurnation");
setLocatiuni58,760;
11i set5ize1880,4113e);
i2 [Link] Font( Arial",Fant.b0L%1S',;
20 try
21
12 GannectianClass
obj=new CannectionC1ass()3
String q='select from Add_bo2L";
111 ResultSst rest
wubj,stmJexecutequery(q);
7J3 while([Link]())
lb
18 y[l][j++]=restJgetString(-64mak_NO");
20 y[i][j++:=rest,gatString.rMak_Nare");
y[i][j+4"=rest,getStringi"Authur');
AI y[i][j++]=rest,getString('QUantity");
32 y[i][J++1=rest,get5tring.rissue_6ursk");
53 y[i][1++]=rest,getString(Tate);
34 i++1
is i=0;
57 t=new nable(y,x);
10 tsetFostCf);
39
ae catchlExceptinn exi
41
42 ex-printStackTrate();
45
44 IStrolipana sp=new 3ScrullPane r.i
as add(sp);
46 1
47 public antic void args)1
413 new ViewInfu(),setVisible:7-.=.;
40 )
S8
[Link]
7 public class Issualook extends ]Frame implements
ActionListenect
8 ]Label 11,12,13,14,15,16,17,18;
9 ]TextField
tfl,tf2,tf3,tf4,tf5,tf6;
10 Panel pl,p2;
11 1Button bt1,bt2;
12 Choice ch;
13 Font fjf1;
14 IssueBook()
15 (
16. soperC"Issue Book Section");
17 setLocationI400,2007;
18 setSize(650,400);
19 f=new
Font("Arial",[Link],25);
20 fl=new
Fonti"Arial"[Link],20);
21 11=new JLabel("Issue Book");
22 12 lew JLabel("Baok
23 13 1ew Label("Book No°};
24 14 new JLabel("Book Name");
25 15=oew JLabel("Student Id");
25 16 1ew JLabel("Student Name");
27 17=oew JLabel("Student
Contact");
28 184Few JLabel("Book
Quantity");
29 btl=new Button("Issue Book");
30 bt2=new Button "Cancel");
31 tfl=new ]TextField .;
32 tf2=new ]TextField •;
33 tf3=new ]TextField .;
34 tf4=new ]TextField .;
35 tf5=new ]TextField •;
36 tf6=new ]Text Field
37 [Link].f1;
38 [Link](f1 ;
39 [Link]:f1
40 [Link]'f1 ;
41 [Link]
42 [Link]
43 17.setFontyF1:;
44 [Link]- •fi
45 [Link] fl
46 [Link] fl
47 [Link] #1.;
48 [Link] #1.;
49 [Link] #1..;
50 [Link] #1.;
51 [Link] #1..;
52 [Link] #1..;
53 [Link](this);
54 [Link]);
55 [Link]%
55 [Link]:
57 ch=new Choice;)';
58 try
59 {
60 CoonectionCiass obj=new ConnectionClass();
61 String q="select Id from Add_Book";
62 ResultSet rest=[Link](q);
63 wnile([Link]())
64
55 [Link]([Link]"Id"
66 }
67
68
69 catch(Exceptioo e)
70
71 [Link]();
72
73 [Link];
74 pl=new Partel.
75 [Link],rew GridLayout(1,1,10,10Y.;
76 [Link] 11.;
77 [Link]“[Link]);
78 p2=new Mane.0
79 [Link] new GridLayout(8,2,10,10P;
80 [Link].L2,;
81 p2..adc*ch);
82 p2.adEK13);
83 p2..add(tf1);
84 [Link] 14:?;
89 [Link] tf2-;
86 [Link] 15 ;
87 [Link] tf3);
88 [Link] 16);
89 [Link] tf4);
90 [Link] 17);
91 p2.addtf5);
92 p2.addj8);
33 p2..ad •.tf6);
94 p2..adeArti);
95 p2..adabt2);
96 settayouVnew
BorderLayout(10,10));
97 add,p1,"North");
9Z add,p2,"Center');
99
lesa ch..addllauseListenernew
MouseAdapter()
101
102 public void
mauseClicked(MouseEvent arg0)
183 46,'
104 try
105
lee anileetionClass obj2=nea
ConnectionClass();
107 int
[Link]([Link]());
100 String ql="select
* from Add_Book where Id--+id+"'";
109 kesultSet
restl=[Link](q1);
110 while([Link]())
111
112
[Link]([Link]?"Eopk_Mo":0;
113
[Link](restl_getString("Bopk_Name));
114 [Link](re
[Link]("Quantity"));
115
116
117
11H catchfExceptien exx)
12
12.8
[Link][];
321 1
125
3,4 ))3
1.5
124 public void
actioneerfurned(ActionEvent e)
138 if,.e.getinnrcefliwwbt11
131
132 int qnt=0;
133
irrt id=[Link](ch.getSelectedItem17);
134 String
8nok_No.[Link]();
siring
8 ok [Link]();
136
int Stadent_Idminteger.parselnt([Link]());
327
String St4dent_Name=[Link]();
134
String Stadent_Cent.[Link]();
139
String Cate∎nero [Link](1.to5tring();
14B try{
143
GennectienClass Dia13..new ConnectionCiassOI
142
String gem-select Quantity
1Frnir. Add Book where
142
ResultSet [Link](qe);
144 while([Link]•
115 {
[Link](-Quantity.));
147
14H If(ents.g)
149 {
150 5013-denPane•si
sainealeingfnull...Monk Quantity is less
1
-1;
151 this-setYlsibleffalsa);
152
113 also
114
string V
.-insert into
Issue_anok(td,gnok_Ne,Rnok_Name,student_rd,Student_kame,Student_Lont,nate) values
C
tse kitont en+. •, • ',gook JfIme
,
...gtodent_Md
,Atudent ••.Student [ont.— ...tatem,.)-;
157
String q3..update Add gunk set issue_ftunk=issue_goak*1 where id.'.1-1d."";
14. [Link]
:LaSE Viewtssueficalk
2- rame
15. [Link]
7 public class Returngook
extends iFrame implements ActionListeneri
8 ]Label 11,12,13;
9 Button btl,bt2;
10 Panel pl,p2;
11 NextField tfl,tf2;
12 Font f,f1;
13 ReturnBook()
14
15- super(lieturn Book");
16 setLocation(400„200);
17 set5ize(500,200);
18 f=new
Font("Arial",[Link],25);
19 fl=new
Font("Aria)",[Link].„20);
20 11=new JLabel("Return
Book"];
21 12=new Eabel("Book No");
22 13-new Eabel("Student
Id");
23 bt1-new ButtoM."Return
Book");
24 tit2=new
3ButtonyTancel");
25
[Link](tnis);
26
[Link](this);
27 tfl=new ilextFieldi.);
28 tf2-new JTextFieldrj;
25 [Link]!..c1;
30 [Link]'fl
31 [Link],f ;
32 [Link] fl
33 [Link] fl
34 [Link] fl ;
35 [Link] fl ;
36
[Link];
37
[Link]([Link];;
35 pl=new Panel);
39 [Link]
6ridLayout(1„1,10,10));„
40 [Link](11);
41
[Link](Color.8LUE);
42 p2-new Faneli);
43 [Link]
5ridLayout(3„2,10,10));
44 [Link]!.12
;
45 [Link](tf1!;
46 [Link],13.;
47 p2..add:Af2,;.
48 p2...add:bt1);
44 p2...add:bt2);
50
setLayoutinew BorderLayout(10,10)•;
51
add01,"North"!;
52
add02,"Center":.;
53
54
55 public void actionPerformed(ActionEyent e)
56
57 String Book_No=[Link]();
58 int Stuld=[Link]([Link]());
59
60 if([Link]()==btl)
61
62 try
63
64 ConnertionClass obj=now Connertiontlass();
65 String q="delete from Issue_Book where Book_No=—+Book No,— and Student_Id=—
+StuId, — ;
66. int res,[Link](q);
67 if(res,==0)
68.
69 [Link](null,"Book Not Issue Yet");
70. [Link]',;
71 1
72 else
73
74 String ql="update Add_Book set Issue_Book=Issue_Book-1 where
Book_No=',1800k_blo+"'";
75 String q2="update Addjook set Quantity=Cuantity.1 where Book_No=—
+Ecok_No,"'";
76 int aaa [Link](q1);
77 int aaaa=[Link](q2);
78
79 if(aaa
= 1)
80
Sl if aaaa ==
32 {
S3 lOptionPanemshowNessageDialog(null,"Hook Return Sucessfully");
84 [Link](true);
S5
56 else
S7 111
sa
[Link](null,"5affleThingWrengl");
ag
90
91
92
93
94 catch(Exception ee)
95
96 eemprintStackTrace();
97 }
93 1
99 if(e.get5ource()==bt21
100
101 thismsetVisible(faIse);
102
103 i-FemgetSource()==bt2)
104
105 thi msetVisible(faIse);
106
107 }
168
109 public static void main{String[] arg$){
110 new ReturnBookOmsetVisible(true);
111
112 )
113
114
Book_Name VARCHAR(50),
Student Id VARCHAR(10),
Student Name VARCHAR(50),
Student Cont VARCHAR(50),
Date VARCHAR(50)
);
CREATE TABLE Add Book
(
Id INTEGER PRIMARY KEY NOT NULL AUTO INCREMENT,
Book No VARCHAR(10) ,
Book_Name VARCHAR(50),
Author varchar(20),
Publisher VARCHAR(50),
Quantity VARCHAR(10),
Issue Book INTEGER DEFAULT 0,
Date VARCHAR(50)
INSERT INTO admin values
("admin","pass123");
SELECT * FROM admin;
INSERT INTO Librarian values
("Librarian","pass123");
UNIT TESTING
Unit testing is undertaken when a module has been created and successfully
reviewed .In order to test a single module we need to provide a complete
environment
ie besides the module we would require Unit testing was done on each and every
module that is described under module description of
1. Test For the admin module
Testing admin login - This is used for log in of admin of the [Link] this we
enter
the username and password if both are correct Admin section will open other wise if
any of data is wrong it will show an error redirected back to the login page and
again
ask for username and password
Testing add new Librarian :- This is used to add new librarian by providing the
correct details . if all details are correct the librarian add to the system other
it throws
error.
Testing view librarian :- This is used to see all information of librarians. if it
shows
all the data the view librarian is working.
FUTURE SCOPE
In adding the design of an online library management system to increase user
interaction.
— Add icons on the center of the admin and login section through which users can
easily
access the required information.
In adding the more features of the online library management system to develop
access
with user's flexibility.
— To authenticate the users based on the system users list which is maintained by
the
operating system
— To restrict the usage of all files by the users based on their privileges on the
system
— Adding the functionality of forgot password.
— Show the book issue and remaining book data in graphs.
References
Youtube
[Link]
JavaTpoint
[Link] [Link]/j ava-tutorial
W3Schools
[Link]