Project Report - Library Management System
Project Report - Library Management System
System
Presented By
P. Aishwarya Naidu
XII A
INFORMATIC PRACTICES
"1
CERTIFICATE
This is to certify that this project work is
done by Ms/Mr.
.
of Class XII in the Informatic Practices
Department of DRS INTERNATIONAL
SCHOOL for the year 2015-2016.
Lecturer Incharge
Dept. of Informatic Practices
INFORMATIC PRACTICES
"2
ACKNOWLEDGEMENT
I am extremely grateful to our informatics practices
teacher Mr. K. Ranga Chary for his invaluable support and
guidance. I am grateful for his extended services not only in
the course of this project, but also throughout the whole
academic year of 2015-16.
INFORMATIC PRACTICES
"3
INFORMATIC PRACTICES
"4
INFORMATIC PRACTICES
"5
AIM
The Library Management System is a type of
information system that is designed & developed for easy and
error free recording of information on various library
processes. It is functional for issuing and receiving of books
in the library along with the students details. The books
received in the library are entered in Books Details form
and the new student is entered in the Student Details form.
When the student wants to get the desired book the same is
issued on the availability basis to the student. The issuance
and due date for the returning of the book is also entered into
the Issue Book form. The student has to pay the fine, if any,
on the basis of number of days delayed deposit of the book in
the library. These type of projects have proved themselves to
be highly effective in way of their functioning and financially
too.
INFORMATIC PRACTICES
"6
Abstract
This tool requires a Relational Database Management
System (RDBMS), which is used to store the information.
MySQL is the preferred software for maintaining the data. It
maintains the information in table form so that it can be
accessed easily.
In the client side, Java NetBeans 6.5.1 is used, providing
the graphical user interface. The requests of the client are
made in the interface, which connect to the tables created in
MySQL for getting the current information.
INFORMATIC PRACTICES
"7
INFORMATIC PRACTICES
"8
INFORMATIC PRACTICES
"9
Project Explorer
INFORMATIC PRACTICES
"10
loginPage.java
Login Button
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt){
String s1=usernameTF.getText();
String s2=passwordTF.getText();
try {
Class.forName("java.sql.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/
library","root","lego");
Statement st = con.createStatement();
String sql ="Select * from login WHERE username ='"+s1+"';";
ResultSet rs=st.executeQuery(sql);
while (rs.next()){
String user=rs.getString("username");
String pass=rs.getString("password");
INFORMATIC PRACTICES
"11
Clear Button
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
usernameTF.setText(null);
passwordTF.setText(null);
}
Register Button
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
registerPage s= new registerPage();
s.setVisible(true);
this.dispose();
}
If login is unsuccesful
INFORMATIC PRACTICES
"12
registerPage.java
Submit Button
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
String code = codeTF.getText();
String s1 = usernameTF.getText();
char c1[] = passwordTF.getPassword();
char c2[] = cpasswordTF.getPassword();
String s2 = new String(c1);
String s3 = new String(c2);
if(code.equals("drsis")) {
if (s2.equals(s3))
try{
Class.forName("java.sql.Driver");
Connection con = DriverManager.getConnection(jdbc:mysql://localhost:3306/
library","root","lego");
Statement st = con.createStatement();
String sql = "insert into login(username, password) values ('"+s1+"',
"+s2+"');";
INFORMATIC PRACTICES
"13
st.executeUpdate(sql);
JOptionPane.showMessageDialog(null, "Registration
Successful");
} catch (Exception e) {
System.out.println(e);
JOptionPane.showMessageDialog(null, "Database connectivity error");
}
} else {
JOptionPane.showMessageDialog(null, "Password does not match");
}
} else {
JOptionPane.showMessageDialog(null, "Incorrect code");
}
}
Clear Button
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
usernameTF.setText(null);
cpasswordTF.setText(null);
codeTF.setText(null);
}
Back Button
private void
jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
loginPage s= new loginPage();
s.setVisible(true);
this.dispose();
}
If registration is succesful
INFORMATIC PRACTICES
"14
HomePage.java
INFORMATIC PRACTICES
"15
Books Button
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
bookDetails s= new bookDetails();
s.setVisible(true);
this.dispose();
}
Students Button
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
studentDetails s= new studentDetails();
s.setVisible(true);
this.dispose();
}
INFORMATIC PRACTICES
"16
s.setVisible(true);
this.dispose();
}
Logout Button
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {
loginPage s= new loginPage();
s.setVisible(true);
this.dispose();
}
searchBooks.java
INFORMATIC PRACTICES
"17
Clear Button
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
INFORMATIC PRACTICES
"18
book_nameTF.setText(null);
book_editionTF.setText(null);
authorTF.setText(null);
}
Home Button
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
HomePage s= new HomePage();
s.setVisible(true);
this.dispose();
}
issueBook.java
Issue Book Button
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String Book_ID = book_idTF.getText();
String Student_ID = student_idTF.getText();
String Issue_Date = issue_dateTF.getText();
String Return_Date = return_dateTF.getText();
try {
Class.forName("java.sql.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/
library","root","lego");
Statement st = con.createStatement();
INFORMATIC PRACTICES
"19
Clear Button
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
book_idTF.setText(null);
student_idTF.setText(null);
INFORMATIC PRACTICES
"20
issue_dateTF.setText(null);
return_dateTF.setText(null);
}
Home Button
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
HomePage s= new HomePage();
s.setVisible(true);
this.dispose();
}
INFORMATIC PRACTICES
"21
returnBook.java
Return Book Button
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
String Book_ID = book_idTF.getText();
try{
Class.forName("java.sql.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/
library","root","lego");
Statement st = con.createStatement();
String sql = "delete from borrower where Book_ID = '"+Book_ID+"';";
st.executeUpdate(sql);
String sql1 = "insert into book select * from lib_ref where Book_ID = '"+Book_ID+"';";
st.executeUpdate(sql1);
JOptionPane.showMessageDialog(null, "Book returned successfully");
} catch (Exception e) {
System.out.println(e);
JOptionPane.showMessageDialog(null, "Database connectivity error");
}
}
INFORMATIC PRACTICES
"22
"23
Statement st = con.createStatement();
String sql2 = "select DATEDIFF(curdate(), Return_Date) from borrower where
Book_ID = '"+Book_ID+"';";
ResultSet rq = st.executeQuery(sql2);
while(rq.next()) {
String s5 = rq.getString("DATEDIFF(curdate(), Return_Date)");
daysTF.setText(s5+"");
INFORMATIC PRACTICES
"24
Clear Button
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
book_idTF.setText(null);
student_idTF.setText(null);
borrow_dateTF.setText(null);
return_dateTF.setText(null);
todays_dateTF.setText(null);
daysTF.setText(null);
fineTF.setText(null);
}
Home Button
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
HomePage s= new HomePage();
s.setVisible(true);
this.dispose();
INFORMATIC PRACTICES
"25
bookDetails.java
try {
Class.forName("java.sql.Driver");
INFORMATIC PRACTICES
"26
INFORMATIC PRACTICES
"27
"28
INFORMATIC PRACTICES
"29
st.executeUpdate(sql1);
JOptionPane.showMessageDialog(null, "Inserted a new book record successfully");
} catch (Exception e) {
System.out.println(e);
JOptionPane.showMessageDialog(null, "Database connectivity error");
}
}
INFORMATIC PRACTICES
"30
Clear Button
private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {
book_idTF.setText(null);
book_nameTF.setText(null);
book_editionTF.setText(null);
authorTF.setText(null);
}
Home Button
private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {
HomePage s= new HomePage();
s.setVisible(true);
this.dispose();
}
INFORMATIC PRACTICES
"31
studentDetails.java
INFORMATIC PRACTICES
"32
ResultSet rs = st.executeQuery(sql);
while(rs.next()){
String s1 = rs.getString("Student_Name");
String s2 = rs.getString("Class");
String s4 = rs.getString("Contact_Number");
student_nameTF.setText(s1+"");
classTF.setText(s2+"");
contact_numberTF.setText(s4+"");
}
st.close();
con.close();
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Enter Student ID correctly");
}
}
INFORMATIC PRACTICES
"33
}
}
INFORMATIC PRACTICES
"34
} catch (Exception e) {
System.out.println(e);
JOptionPane.showMessageDialog(null, "Database connectivity error"); }
}
INFORMATIC PRACTICES
"35
st.executeUpdate(sql);
JOptionPane.showMessageDialog(null, "Student deleted from library records");
student_idTF.setText(null);
student_nameTF.setText(null);
classTF.setText(null);
contact_numberTF.setText(null);
} catch (Exception e) {
System.out.println(e);
JOptionPane.showMessageDialog(null, "Database connectivity error");
}
}
INFORMATIC PRACTICES
"36
Clear Button
private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {
student_idTF.setText(null);
student_nameTF.setText(null);
classTF.setText(null);
contact_numberTF.setText(null);
}
Home Button
private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {
HomePage s= new HomePage();
s.setVisible(true);
this.dispose();
}
libraryReference.java
INFORMATIC PRACTICES
"37
Clear Button
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {
book_idTF.setText(null);
book_nameTF.setText(null);
book_editionTF.setText(null);
authorTF.setText(null);
}
INFORMATIC PRACTICES
"38
Home Button
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {
HomePage s= new HomePage();
s.setVisible(true);
this.dispose();
}
try {
Class.forName("java.sql.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/
library","root","lego");
Statement st = con.createStatement();
INFORMATIC PRACTICES
"39
INFORMATIC PRACTICES
"40
BIBLIOGRAPHY
Informatics Practices by Sumita Arora
Move Fast with IP By Sumita Arora
Together With IP by Rachana Sagar
Internet
INFORMATIC PRACTICES
"41