0% found this document useful (0 votes)
281 views58 pages

I.P Project Report CLASS XII CBSE

This document describes a library management system project created using Java and MySQL. It includes information about the technologies used, system requirements, GUI frame structures and flowcharts, code snippets for various frames and buttons. The frames include the main home frame, login frame, registration frame, and home frame after login. Code is provided for functions like registering a new user, logging in, and navigating between frames. Database tables are also created to store user and book information.

Uploaded by

Vidyanshu kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
281 views58 pages

I.P Project Report CLASS XII CBSE

This document describes a library management system project created using Java and MySQL. It includes information about the technologies used, system requirements, GUI frame structures and flowcharts, code snippets for various frames and buttons. The frames include the main home frame, login frame, registration frame, and home frame after login. Code is provided for functions like registering a new user, logging in, and navigating between frames. Database tables are also created to store user and book information.

Uploaded by

Vidyanshu kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 58

2019-20

TOPIC:- LIBRARY MANAGEMENT

GUIDED BY : RAVINDRA KUMAR


BOARD ROLL NO.:-
SUBMITTED BY :- PRIYANSHU KUMAR
1

Acknowledgement
I would like to express my sincere gratitude to my I.P. teacher

Mr. RAVINDRA KUMAR Sir for his vital support, guidance and

encouragement without which this assignment would not

have come forth. Secondly I would like to thanks our school

management for providing us such a magnificent school lab, I

would also like to thanks my parents for their support and

encouragement and for providing me all the resources needed

to complete this project.

-PRIYANSHU KUMAR
2
3

INDEX
S.NO TITLE P NO.
1. ABSTRACT 4
2. INFORMATION ABOUT JAVA 5
3. INFORMATION ABOUT MySQL 6
4. SYSTEM REQUIREMENTS 7
5. GUI AND PROGRAMMING 8 -47
6. DATABASE DETAILS 48-50
7. SCREENSHOTS 51-56
8. BIBLIOGRAPHY 57
4

Abstract
Introduction:
This Project is based on the topic library management. I have used
MYSQL (a DBMS software) and JAVA (general-
purpose programming language for creation of GUI) to create a
user friendly data management software which helps us to mange
data required to maintain a library.

Benefits of using electronic data processing over


manual processing: -

 Manual processing requires lengthy time span while the


software helps us to maintain data in less time and in efficient
way.
 The software is user friendly hence very less skillset is
required to operate this.
5

 The software represents data in a well-organized decent way


while manual processing varies from person to person due to
change in handwriting.
 A single employee can operate it hence less no. of workers
required.

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 2018, Java was one of the most popular
programming languages in use. particularly for client-server web
applications, with a reported 9 million developers.
Java was originally developed by James Gosling at Sun
Microsystems (which has since been acquired by Oracle) and
6

released in 1995 as a core component of Sun Microsystems' Java


platform. The original and reference implementation
Java compilers, virtual machines, and class libraries were
originally released by Sun under proprietary licenses.

MySQL is an open-source relational database management


system (RDBMS). Its name is a combination of "My", the name of
co-founder Michael Widenius's daughter, and "SQL", the
abbreviation for Structured Query Language.
MySQL is free and open-source software under the terms of
the GNU General Public License, and is also available under a
variety of proprietary licenses. MySQL was owned and sponsored
by the Swedish company MySQL AB, which was bought by Sun
Microsystems (now Oracle Corporation). In 2010, when Oracle
acquired Sun, Widenius forked the open-source MySQL project to
create MariaDB.
MySQL is a component of the LAMP web application software
stack (and others), which is an acronym for Linux, Apache,
MySQL, Perl/PHP/Python. MySQL is used by many database-
driven web applications, including Drupal, Joomla, phpBB,
and WordPress. MySQL is also used by many popular websites,
including Facebook, Flickr, MediaWiki, Twitter, and YouTube.
7

Software requirements: -

 Operating System: Mac, Linux, Windows


 JDK: 1.6 or above
 JRE: 1.6 or above
 NetBeans
 Notepad
 MySQL
 SQL Developer

Hardware requirements: -

 Monitor
 Mouse
 Keyboard
 RAM: 512 MB or more
 HDD storage: 256 GB or more
 Processor: P4 or higher
 Micro Processor: intel Pentium (quad core) or higher
8
9

JFRAME NAMES AND FLOW CHARTS : -

MAIN_HOME

LOGIN_FORM REGISTERATION_FORM

HOME

CUSTOMER PROVIDER

BOOK_SEARCH RENT
10

BOOK_ADDITION

GUI for “MAIN_HOME” j_frame: -

Code for “LOGIN” button: -


LOGIN_FORM lgf = new LOGIN_FORM();
lgf.setVisible(true);
lgf.pack();
11

lgf.setLocationRelativeTo(null);
lgf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();

code for “REGISTER” button:-


REGISTERATION_FORM rgf = new REGISTERATION_FORM();
rgf.setVisible(true);
rgf.pack();
rgf.setLocationRelativeTo(null);
rgf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
code for “EXIT” button:-
System.exit(0);
12

GUI for “REGISTRATION_FORM” j_frame :-

Code for “REGISTER” button:-


13

String url="jdbc:Mysql://localhost/LIBRARY_MANAGER";
String user="root";
String pwd="XIB35";
String fname=t1.getText();
String lname = t2.getText();
String uname = t3.getText();
String pass = String.valueOf(p2.getPassword());
String re_pass = String.valueOf(p1.getPassword());
String address = ta.getText();
if(uname.equals(""))
{
JOptionPane.showMessageDialog(null, "Add A Username");
}

else if(pass.equals(""))
{
JOptionPane.showMessageDialog(null, "Add A Password");
}
else if(!pass.equals(re_pass))
{
JOptionPane.showMessageDialog(null, "Retype The Password
Again");
14

}
else if(checkUsername(uname))
{
JOptionPane.showMessageDialog(null, "This Username Already
Exist") }
else{
PreparedStatement ps;
String query = "INSERT INTO LIBRARY_USERS VALUES(?,?,?,?,?)";
try {
Connection con=DriverManager.getConnection(url,user,pwd);
ps = con.prepareStatement(query);
ps.setString(1, fname);
ps.setString(2, lname);
ps.setString(3, uname);
ps.setString(4, pass);
ps.setString(5, address);
if(ps.executeUpdate() > 0)
{
JOptionPane.showMessageDialog(null, "New User Added");
}
15

} catch (SQLException ex) {


Logger.getLogger(REGISTERATION_FORM.class.getName()).log(Level.SE
VERE, null, ex);
} }
Code for “CLICK HERE TO LOGIN” label :-
LOGIN_FORM lgf = new LOGIN_FORM();
lgf.setVisible(true);
lgf.pack();
lgf.setLocationRelativeTo(null);
lgf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
Code for checkUsername Boolean:-
public boolean checkUsername(String username)
{
String url="jdbc:Mysql://localhost/LIBRARY_MANAGER";
String user="root";
String pwd="XIB35";
PreparedStatement ps;
ResultSet rs;
boolean checkUser = false;
String query = "SELECT * FROM LIBRARY_USERS WHERE
USER_NAME =?";
16

try {
Connection con=DriverManager.getConnection(url,user,pwd);
ps = con.prepareStatement(query);
ps.setString(1, username);

rs = ps.executeQuery();
if(rs.next())
{
checkUser = true;
}
} catch (SQLException ex) {
JOptionPane.showMessageDialog(this,ex.getMessage());
}
return checkUser;
}
Code for “CANCEL” button :-
System.exit(0);
17

GUI for “LOGIN_FORM” j_frame:-

Code for “LOGIN” button :-


PreparedStatement ps;
ResultSet rs;
18

String url="jdbc:Mysql://localhost/LIBRARY_MANAGER";
String user="root";
String pwd="XIB35";
String uname = t1.getText();
String pass = String.valueOf(p1.getPassword());
String query = "SELECT * FROM LIBRARY_USERS WHERE
USER_NAME =? AND PASSWORD =?";
try {
Connection con=DriverManager.getConnection(url,user,pwd);
ps = con.prepareStatement(query);
ps.setString(1, uname);
ps.setString(2, pass);
rs = ps.executeQuery();
if(rs.next())
{
HOME mf = new HOME();
mf.setVisible(true);
mf.pack();
mf.setLocationRelativeTo(null);
mf.setExtendedState(JFrame.EXIT_ON_CLOSE);
this.dispose();
}else
19

{
JOptionPane.showMessageDialog(null, "Incorrect Username Or
Password", "Login Failed", 2);
}

} catch (SQLException ex) {


Logger.getLogger(LOGIN_FORM.class.getName()).log(Level.SEVERE,
null, ex);
}
Code for “CLICK HERE TO REGISTER” label:-
REGISTERATION_FORM rgf = new REGISTERATION_FORM();
rgf.setVisible(true);
rgf.pack();
rgf.setLocationRelativeTo(null);
rgf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
Code for “CANCEL” button:-
system.exit(0);
20

GUI for “HOME” j_frame:-

Code for “CUSTOMER” button:-


CUSTOMER cr = new CUSTOMER();
cr.setVisible(true);
cr.pack();
cr.setLocationRelativeTo(null);
21

cr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
Code for “PROVIDER” button:-
PROVIDER pr = new PROVIDER();
pr.setVisible(true);
pr.pack();
pr.setLocationRelativeTo(null);
pr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
Code for “LOGOUT” button:-
MAIN_HOME mh = new MAIN_HOME();
mh.setVisible(true);
mh.pack();
mh.setLocationRelativeTo(null);
mh.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
code for “EXIT” button:-
System.exit(0);
22

GUI FOR “CUSTOMER” j_frame:-

Code for “SEARCH A BOOK” button:-


BOOK_SEARCH bs = new BOOK_SEARCH();
bs.setVisible(true);
bs.pack();
bs.setLocationRelativeTo(null);
bs.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
23

this.dispose();

Code for “RENT A BOOK” button:-


RENT rt = new RENT();
rt.setVisible(true);
rt.pack();
rt.setLocationRelativeTo(null);
rt.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
Code for “BACK” button :-
HOME mf = new HOME();
mf.setVisible(true);
mf.pack();
mf.setLocationRelativeTo(null);
mf.setExtendedState(JFrame.EXIT_ON_CLOSE);
this.dispose();
Code for “LOGOUT” button :-
MAIN_HOME mh = new MAIN_HOME();
mh.setVisible(true);
mh.pack();
mh.setLocationRelativeTo(null);
24

mh.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();

Code for “EXIT”:-


System.exit(0);
25

GUI for “BOOK_SEARCH” j_frame:-

Code for “SEARCH” button :-


DefaultTableModel model=(DefaultTableModel)TABLE.getModel();
ResultSet rs;
PreparedStatement ps;
String url="jdbc:Mysql://localhost/LIBRARY_MANAGER";
String user="root";
String pwd="XIB35";
String name= "%"+t1.getText()+"%";
String author="%"+t2.getText()+"%";
26

String pub="%"+t3.getText()+"%";
String yoi="%"+t4.getText()+"%";
String genre=String.valueOf("%"+cb1.getSelectedItem()+"%");
String a = null;
String b="welcome";
if(rb1.isSelected())
{
a = "b_name"+" "+"like"+" "+"\""+"%"+t1.getText()+"%"+"\"";
}
else if(rb2.isSelected())
{
a = "author"+" "+"like"+" "+"\""+"%"+t2.getText()+"%"+"\"";
}
else if(rb3.isSelected())
{
a = "yoi"+" "+"like"+" "+"\""+"%"+t4.getText()+"%"+"\"";
}
else if(rb4.isSelected())
{
a = "publication"+" "+"like"+""+"\""+"%"+t3.getText()+"%"+"\"";
}
27

else if(rb5.isSelected())
{
a = "genre"+" "+"like"+" "+"\""
+String.valueOf("%"+cb1.getSelectedItem()+"%")+"\"";
}
else if(rb6.isSelected())
{
a = "b_id"+"="+t5.getText();
}
String query = "select b_id,b_name,author,yoi,publication,rent_price,”
+“genre from book_details where"+" "+a;
try {
Connection con=DriverManager.getConnection(url,user,pwd);
Statement stm = con.createStatement();
rs=stm.executeQuery(query);
while(rs.next()){
String bid=rs.getString("b_id");
String bname=rs.getString("b_name");
String AUTHOR=rs.getString("author");
String YOI=rs.getString("yoi");
String publication=rs.getString("publication");
String rp=rs.getString("rent_price");
28

String GENRE=rs.getString("genre");
model.addRow(new Object[]
{bid,bname,AUTHOR,YOI,publication,rp,GENRE});}
rs.close();
stm.close();
con.close();
}catch (SQLException ex) {
JOptionPane.showMessageDialog(this,ex.getMessage());
}
Code for radio button “BOOK NAME” :-
t1.setEditable(true);
t2.setEditable(false);
t3.setEditable(false);
t4.setEditable(false);
t5.setEditable(false);
cb1.setEditable(false);
t1.setText("");
t2.setText("");
t3.setText("");
t4.setText("");
t5.setText("");
DefaultTableModel model=(DefaultTableModel)TABLE.getModel();
29

model.setRowCount(0);
Code for radio button “AUTHOR” :-
t1.setEditable(false);
t2.setEditable(true);
t3.setEditable(false);
t4.setEditable(false);
t5.setEditable(false);
cb1.setEditable(false);
DefaultTableModel model=(DefaultTableModel)TABLE.getModel();
model.setRowCount(0);
t1.setText("");
t2.setText("");
t3.setText("");
t4.setText("");
t5.setText("");
Code for radio button “EDITION” :-
t1.setEditable(false);
t2.setEditable(false);
t3.setEditable(false);
t4.setEditable(true);
t5.setEditable(false);
30

cb1.setEditable(false);
DefaultTableModel model=(DefaultTableModel)TABLE.getModel();
model.setRowCount(0);
t1.setText("");
t2.setText("");
t3.setText("");
t4.setText("");
t5.setText("");
Code for radio button “PUBLICATION”:-
t1.setEditable(false);
t2.setEditable(false);
t3.setEditable(true);
t4.setEditable(false);
t5.setEditable(false);
cb1.setEditable(false);
DefaultTableModel model=(DefaultTableModel)TABLE.getModel();
model.setRowCount(0);
t1.setText("");
t2.setText("");
t3.setText("");
t4.setText("");
31

t5.setText("");
Code for radio button “GENRE” :-
t1.setEditable(false);
t2.setEditable(false);
t3.setEditable(false);
t4.setEditable(false);
t5.setEditable(false);
cb1.setEditable(true);
DefaultTableModel model=(DefaultTableModel)TABLE.getModel();
model.setRowCount(0);
t1.setText("");
t2.setText("");
t3.setText("");
t4.setText("");
t5.setText("");
Code for radio button “BOOK ID” :-
t1.setEditable(false);
t2.setEditable(false);
t3.setEditable(false);
t4.setEditable(false);
t5.setEditable(true);
32

cb1.setEditable(false);
DefaultTableModel model=(DefaultTableModel)TABLE.getModel();
model.setRowCount(0);
t1.setText("");
t2.setText("");
t3.setText("");
t4.setText("");
t5.setText("");

code for “RESET” button :-


DefaultTableModel model=(DefaultTableModel)TABLE.getModel();
model.setRowCount(0);
t1.setText("");
t2.setText("");
t3.setText("");
t4.setText("");
t5.setText("");
code for “RENT BOOK” button :-
RENT re = new RENT();
re.setVisible(true);
re.pack();
33

re.setLocationRelativeTo(null);
re.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
code for “BACK” button :-
CUSTOMER cr = new CUSTOMER();
cr.setVisible(true);
cr.pack();
cr.setLocationRelativeTo(null);
cr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
Code for “LOGOUT” button :-
MAIN_HOME mh = new MAIN_HOME();
mh.setVisible(true);
mh.pack();
mh.setLocationRelativeTo(null);
mh.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
Code for “EXIT” button :-
System.exit(0);
34

GUI for “RENT” j_frame:-

Code for “RENT BOOK” button:-


PreparedStatement ps;
String url="jdbc:Mysql://localhost/LIBRARY_MANAGER";
String user="root";
String pwd="XIB35";
String u_name=t1.getText();
35

String b_id=t2.getText();

if(u_name.equals(""))
{
JOptionPane.showMessageDialog(null, "Enter Username");
}

else if(b_id.equals(""))
{
JOptionPane.showMessageDialog(null, "enter book id");
}
else if(checkUsername(u_name))
{
JOptionPane.showMessageDialog(null, "This Username doesn't
Exist");
}else{
if(checkBook(b_id))
{
JOptionPane.showMessageDialog(null, "This book id doesn't
Exist");
}else{
String query="insert into rent_details values(?,?)";
36

try {
Connection con=DriverManager.getConnection(url,user,pwd);
ps=con.prepareStatement(query);
ps.setString(1,u_name);
ps.setString(2,b_id);
if(ps.executeUpdate() > 0)
{
JOptionPane.showMessageDialog(null, "rent successful");
}
}catch (SQLException ex) {
JOptionPane.showMessageDialog(this,ex.getMessage());
}
}
}
Code for “SEARCH BOOK” button :-
BOOK_SEARCH bs = new BOOK_SEARCH();
bs.setVisible(true);
bs.pack();
bs.setLocationRelativeTo(null);
bs.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
37

Code for “BACK” button :-


CUSTOMER cr = new CUSTOMER();
cr.setVisible(true);
cr.pack();
cr.setLocationRelativeTo(null);
cr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
Code for “LOGOUT” button :-
MAIN_HOME mh = new MAIN_HOME();
mh.setVisible(true);
mh.pack();
mh.setLocationRelativeTo(null);
mh.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
Code for checkUsername Boolean:-
String url="jdbc:Mysql://localhost/LIBRARY_MANAGER";
String user="root";
String pwd="XIB35";
PreparedStatement ps;
ResultSet rs;
boolean checkUser = true;
38

String query = "SELECT * FROM LIBRARY_USERS WHERE


USER_NAME =?";
try {
Connection con=DriverManager.getConnection(url,user,pwd);
ps = con.prepareStatement(query);
ps.setString(1, username);
rs = ps.executeQuery();
if(rs.next())
{
checkUser = false;
}
} catch (SQLException ex) {
JOptionPane.showMessageDialog(this,ex.getMessage());
}
return checkUser;
Code for checkBook Boolean:-
String url="jdbc:Mysql://localhost/LIBRARY_MANAGER";
String user="root";
String pwd="XIB35";
PreparedStatement ps;
ResultSet rs;
boolean checkUser = true;
39

String query = "SELECT * FROM book_details WHERE b_id =?";


try {
Connection con=DriverManager.getConnection(url,user,pwd);
ps = con.prepareStatement(query);
ps.setString(1, b_id);
rs = ps.executeQuery();

if(rs.next())
{
checkUser = false;
}
} catch (SQLException ex) {
JOptionPane.showMessageDialog(this,ex.getMessage());
}
return checkUser;
Code for “EXIT” :-
System.exit(0);
40

GUI for “PROVIDER” j_frame:-

Code for “ADD/DONATE A BOOK” button :-


BOOK_ADDITION ba = new BOOK_ADDITION();
ba.setVisible(true);
ba.pack();
ba.setLocationRelativeTo(null);
ba.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
41

Code for “BACK” button :-


HOME mf = new HOME();
mf.setVisible(true);
mf.pack();
mf.setLocationRelativeTo(null);
mf.setExtendedState(JFrame.EXIT_ON_CLOSE);
this.dispose();
Code for “LOGOUT” button :-
MAIN_HOME mh = new MAIN_HOME();
mh.setVisible(true);
mh.pack();
mh.setLocationRelativeTo(null);
mh.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
Code for “EXIT” button :-
System.exit(0);
42

GUI for “BOOK_ADDITION” j_frame :-

Code for “ADD” button:-


PreparedStatement ps;
String url="jdbc:Mysql://localhost/LIBRARY_MANAGER";
String user="root";
String pwd="XIB35";
String name= T1.getText();
String author= T2.getText();
String yoi=t5.getText();
43

String pub=T3.getText();
double price;
String genre=String.valueOf(cb1.getSelectedItem());
if(name.equals(""))
{
JOptionPane.showMessageDialog(null, "Add A Name");
}
else if(author.equals(""))
{
JOptionPane.showMessageDialog(null, "Add A Author");
}
else if(yoi.equals(""))
{
JOptionPane.showMessageDialog(null, "Add A Edition year");
}
else if(pub.equals(""))
{
JOptionPane.showMessageDialog(null, "Add A Publisher");
}
else if(T4.getText().equals(""))
{
44

JOptionPane.showMessageDialog(null, "Enter valid price");


}
else if(checkBook(name,author,yoi))
{
JOptionPane.showMessageDialog(null, "We appreciate your
effort, but we already have this book");
}
else
{
price= Double.parseDouble(T4.getText());
String p=String.valueOf(price);
double rent_price=0.2*price;
String r=String.valueOf(rent_price);
String query="insert into book_details
(b_name,author,yoi,publication,price,genre,rent_price)"
+ " values(?,?,?,?,?,?,?)";
try {
Connection con=DriverManager.getConnection(url,user,pwd);
ps=con.prepareStatement(query);
ps.setString(1,name);
ps.setString(2,author);
ps.setString(3,yoi);
45

ps.setString(4,pub);
ps.setString(5,p);
ps.setString(6,genre);
ps.setString(7,r);
if(ps.executeUpdate() > 0)
{
JOptionPane.showMessageDialog(null, "New book Added");
}
}catch (SQLException ex) {
JOptionPane.showMessageDialog(this,ex.getMessage());
}
}
Code for checkBook Boolean:-
String url="jdbc:Mysql://localhost/LIBRARY_MANAGER";
String user="root";
String pwd="XIB35";
PreparedStatement ps;
ResultSet rs;
boolean checkUser = false;
String query = "SELECT * FROM book_details WHERE B_NAME =? &&
AUTHOR=? && YOI=?";
try {
46

Connection con=DriverManager.getConnection(url,user,pwd);
ps = con.prepareStatement(query);
ps.setString(1, name);
ps.setString(2, author);
ps.setString(3, yoi);
rs = ps.executeQuery();
if(rs.next())
{
checkUser = true;
}
} catch (SQLException ex) {
JOptionPane.showMessageDialog(this,ex.getMessage());
}
return checkUser;
Code for “BACK” button:-
PROVIDER pr = new PROVIDER();
pr.setVisible(true);
pr.pack();
pr.setLocationRelativeTo(null);
pr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
47

Code for “LOGOUT” button:-


MAIN_HOME mh = new MAIN_HOME();
mh.setVisible(true);
mh.pack();
mh.setLocationRelativeTo(null);
mh.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
Code for “EXIT” button:-
System.exit(0);
48
49

Database name:

LIBRARY_MANAGER

Table names:

 BOOK_DETAILS
 RENT_DETAILS
 LIBRARY_USERS

BOOK_DETAILS:

FIELD TYPE NULL KEY DEFAULT EXTRAS


B_ID INT(5) NO PRIMARY NULL AUTO_INCREMENT
B_NAME VARCHAR(20) NO NULL
AUTHOR VARCHAR(20) YES NULL
YOI YEAR(4) YES NULL
PUBLICATION VARCHAR(20) YES NULL
PRICE DECIMAL(6,2) YES NULL
GENRE VARCHAR(20) YES NULL
RENT_PRICE DECIMAL(5,2) YES NULL

RENT_DETAILS:

FIELD TYPE NULL KEY DEFAULT EXTRAS


B_ID INT(5) YES NULL
UNAME VARCHAR(40) YES NULL
50

LIBRARY_USERS:

FIELD TYPE NULL KEY DEFAULT EXTRAS


FIRST_NAME VARCHAR(20) YES NULL
LAST_NAME VARCHAR(20) YES NULL
USER_NAME VARCHAR(40) NO PRIMARY NULL
PASSWORD VARCHAR(30) YES NULL
ADDRESS VARCHAR(200) YES NULL
51
52

Registration form
53

Login_form
54

Book_Search
55

Rent
56

Book_addition
57

BIBLIOGRAPHY
WEBSITES USED:-

 http://www.wikipedia.com
 http://www.wikihow.com

BOOKS USED:-

 Informatics practices class XII by Sumita Arora.

You might also like