0% found this document useful (0 votes)
130 views34 pages

Library Management System in Python

This document is a project report for a Library Management System created using Tkinter in Python. It includes sections on basic Python concepts like classes, objects, inheritance as well as specific code for database connectivity, login functionality, and the overall project. The report was submitted to fulfill requirements for a B.E/B.TECH degree by students Suraj Kumar and Md Islam Ansari.

Uploaded by

SurajYT Vlogs
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)
130 views34 pages

Library Management System in Python

This document is a project report for a Library Management System created using Tkinter in Python. It includes sections on basic Python concepts like classes, objects, inheritance as well as specific code for database connectivity, login functionality, and the overall project. The report was submitted to fulfill requirements for a B.E/B.TECH degree by students Suraj Kumar and Md Islam Ansari.

Uploaded by

SurajYT Vlogs
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

LIBRARY MANAGEMENT SYSTEM

Using Tkinter in Python 3

SESSION 2019-2020

Submitted To :-

Debjit Banerjee

Sign :- _________

Submitted By :-

SURAJ KUMAR
Md Islam Ansari
DECLARATION
We hereby declare that this project report entitled "LIBRARY
MANAGEMENT SYSTEM” using Tkinter in PYTHON
submitting for partially fulfillment of the requirement for the
B.E/ [Link]. This report is only for educational purpose and
not for the purpose

Diwita Banerjee (171001001116)

Sugata Ghosh (14700119063)

Adrija Dasgupta (14200119048)


Acknowledgement
We are most obliged and grateful to our guide Debjit
Banerjee
for all proper guidance in completing this project
successfully. We are also grateful for right guidance and
advice at the crucial junctures and for showing us the right
way helping us completing this project successfully. We are
most obliged and grateful to our guide for support and
encouraging us throughout the course of study and we also
take the help from
[Link]&[Link]

Finally, we acknowledge with gratitude the unflagging


support and patience of our team members for their
guidance and encouragement during this dissertation work.
CONTENTS

 Basic Language Element

 Object Oriented
Programming

 Extending Classes and


Inheritance

 Array & String


1.

 Exception Handling

 Package

 File Handling
What is java:-
Java is a programming
language and computing platform first
released by Sun Microsystems in 1995.
There are lots of applications and
websites that will not work unless you
have Java installed, and more are created
every day. Java is fast, secure, and
reliable. From laptops to datacenters,
game consoles to scientific
supercomputers, cell phones to the
Internet, Java is everywhere.
What can java do?
 Development Tools: The development tools provide
everything you'll need for compiling, running, monitoring,
debugging, and documenting your applications. As a new
developer, the main tools you'll be using are
the javac compiler, the java launcher, and
the javadoc documentation tool.
 Application Programming Interface (API): The API
provides the core functionality of the Java programming
language. It offers a wide array of useful classes ready for
use in your own applications. It spans everything from
basic objects, to networking and security, to XML
generation and database access, and more. The core API
is very large; to get an overview of what it contains,
consult the Java Platform Standard Edition 8
Documentation.
 Deployment Technologies: The JDK software provides
standard mechanisms such as the Java Web Start
software and Java Plug-In software for deploying your
applications to end users.
 User Interface Toolkits: The JavaFX, Swing, and Java
2D toolkits make it possible to create sophisticated
Graphical User Interfaces (GUIs).
 Integration Libraries: Integration libraries such as the
Java IDL API, JDBC API, Java Naming and Directory
Interface (JNDI) API, Java RMI, and Java Remote Method
Invocation over Internet Inter-ORB Protocol Technology
(Java RMI-IIOP Technology) enable database access and
manipulation of remote objects.
Class:-
A class is an entity that determines how an object will
behave and what the object will contain. In other
words, it is a blueprint or a set of instruction to build a
specific type of object.
Syntax:-
class <class_name>{
field;
method;
}

Object:-
An object is nothing but a self-contained component
which consists of methods and properties to make a
particular type of data useful. Object determines the
behavior of the class. When you send a message to an
object, you are asking the object to invoke or execute
one of its methods.

Syntax:-
ClassName ReferenceVariable =new
ClassName();
Inheritance:-
Inheritance is an important pillar of OOP(Object
Oriented Programming). It is the mechanism in java by
which one class is allow to inherit the features(fields and
methods) of another class.
Important terminology:
 Super Class: The class whose features are inherited

is known as super class(or a base class or a parent


class).
 Sub Class: The class that inherits the other class is

known as sub class(or a derived class, extended


class, or child class). The subclass can add its own
fields and methods in addition to the superclass
fields and methods.
 Reusability: Inheritance supports the concept of

“reusability”, i.e. when we want to create a new class


and there is already a class that includes some of the
code that we want, we can derive our new class from
the existing class. By doing this, we are reusing the
fields and methods of the existing class.

Syntax :-
class derived-class extends base-class
{
//methods and fields
}
PROJECT ON LIBRARY MANAGEMENT
SYSTEM USING SWING AND XAMPP
DATABSE
CODE:-
DATA BASE CONNECTION:-

package projectPackage;

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

public class DatabaseConnection {

String url = "jdbc:mysql://localhost:3306/account";


String username = "root";
String password = "";

public void databaseConnect(){


try {
[Link]("[Link]");
databaseConnection();
} catch (ClassNotFoundException ex) {
[Link]([Link]
()).log([Link], null, ex);
}
}

public Connection databaseConnection() {


//throw new
UnsupportedOperationException("Not supported
yet."); //To change body of generated methods,
choose Tools | Templates.
Connection connection=null;
try{
connection= DriverManager
.getConnection(url,username, password);
[Link]("SQL Connection to
database established!");
}
catch(SQLException e ){
[Link](e);
}
return connection;

public static void main(String[] args) {


DatabaseConnection connection = new
DatabaseConnection();

[Link]();

}
}
CODE:-
LOGIN PAGE:-

package projectPackage;

import [Link];
import [Link];
import [Link];

public class Login extends [Link] {


Connection connection;
ResultSet rs;
PreparedStatement pst;

public Login() {
super("Login");
initComponents();
DatabaseConnection dc = new
DatabaseConnection();
connection= [Link]();
}

@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed"
desc="Generated Code">
private void initComponents() {
jPanel1 = new [Link]();
jButton3 = new [Link]();
jLabel1 = new [Link]();
jButton1 = new [Link]();
jLabel2 = new [Link]();
jTextField1 = new [Link]();
jLabel3 = new [Link]();
jPasswordField1 = new
[Link]();
jButton2 = new [Link]();

setDefaultCloseOperation([Link]
nts.EXIT_ON_CLOSE);

[Link]([Link]
tledBorder([Link]
er(new [Link](255, 153, 0)), "Login",
[Link].DEFAULT_JUSTIFICAT
ION,
[Link].DEFAULT_POSITION,
new [Link]("Tahoma", 0, 24), new
[Link](0, 255, 204))); // NOI18N

[Link]("Forget password");
[Link](new
[Link]() {
public void
actionPerformed([Link] evt) {
jButton3ActionPerformed(evt);
}
});

[Link](new [Link]("Tahoma", 0,
18)); // NOI18N
[Link]("Username ");

[Link]("Login");
[Link](new
[Link]() {
public void
actionPerformed([Link] evt) {
jButton1ActionPerformed(evt);
}
});

[Link](new [Link]("Tahoma", 0,
18)); // NOI18N
[Link]("Password");

[Link](new [Link]("Tahoma", 1,
12)); // NOI18N
[Link](new [Link](255,
51, 51));
[Link]("Truble Login");

[Link]([Link]
.createLineBorder(new [Link](0, 0, 0)));

[Link]("Signup");
[Link](new
[Link]() {
public void
actionPerformed([Link] evt) {
jButton2ActionPerformed(evt);
}
});

[Link] jPanel1Layout = new


[Link](jPanel1);
[Link](jPanel1Layout);
[Link](

[Link]([Link]
[Link])

.addGroup([Link]()
.addContainerGap()
.addGroup([Link](javax.s
[Link])

.addGroup([Link]()

.addGroup([Link](javax.s
[Link])
.addComponent(jLabel2)
.addComponent(jLabel1))
.addGap(56, 56, 56)

.addGroup([Link](javax.s
[Link], false)

.addGroup([Link]()
.addComponent(jButton1)

.addPreferredGap([Link]
[Link],
[Link].DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(jButton2))
.addComponent(jTextField1)
.addComponent(jPasswordField1,
[Link].PREFERRED_SIZE, 212,
[Link].PREFERRED_SIZE)))
.addGroup([Link]()
.addComponent(jLabel3)
.addGap(90, 90, 90)
.addComponent(jButton3,
[Link].PREFERRED_SIZE, 134,
[Link].PREFERRED_SIZE)))
.addContainerGap(44, Short.MAX_VALUE))
);
[Link](

[Link]([Link]
[Link])

.addGroup([Link]()
.addContainerGap()

.addGroup([Link](javax.s
[Link])
.addComponent(jLabel1)
.addComponent(jTextField1,
[Link].PREFERRED_SIZE,
[Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE))
.addGap(27, 27, 27)

.addGroup([Link](javax.s
[Link])
.addComponent(jLabel2)
.addComponent(jPasswordField1,
[Link].PREFERRED_SIZE,
[Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE))
.addGap(18, 18, 18)

.addGroup([Link](javax.s
[Link])
.addComponent(jButton1)
.addComponent(jButton2))

.addPreferredGap([Link]
[Link])

.addGroup([Link](javax.s
[Link])
.addComponent(jButton3)
.addComponent(jLabel3))
.addContainerGap(44, Short.MAX_VALUE))
);

[Link] layout = new


[Link](getContentPane());
getContentPane().setLayout(layout);
[Link](
[Link]([Link].
[Link])

.addGroup([Link]
ING, [Link]()
.addContainerGap(167, Short.MAX_VALUE)
.addComponent(jPanel1,
[Link].PREFERRED_SIZE,
[Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addGap(130, 130, 130))
);
[Link](

[Link]([Link].
[Link])
.addGroup([Link]()
.addGap(104, 104, 104)
.addComponent(jPanel1,
[Link].PREFERRED_SIZE,
[Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addContainerGap(98, Short.MAX_VALUE))
);

setSize(new [Link](733, 494));


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

private void
jButton1ActionPerformed([Link]
t evt) {
// TODO add your handling code here:
String sql= " select * from table where
Username? and Password=?";
try
{
pst=[Link](sql);
[Link](1,[Link]());
[Link](3,[Link]());
rs= [Link]();
// if ([Link]())
// {
// [Link]();
// [Link]();
// setVisible(false);
// Loading ob=new Loading();
// [Link](true);
// }
// else{
// [Link]("Incorrect Username
and Password");
// }

}catch(Exception e)
{
[Link](e);
}finally
{
try{

[Link]();
[Link]();
}
catch(Exception e)
{

}
}
private void
jButton3ActionPerformed([Link]
t evt) {
// TODO add your handling code here:
setVisible(false);
Forget ob=new Forget();
[Link](true);

}
private void
jButton2ActionPerformed([Link]
t evt) {
// TODO add your handling code here:
setVisible(false);
Signup ob=new Signup();
[Link](true);
}

jLabel5 = new [Link]();


jTextField4
[Link]("Return");
[Link](new
[Link]() {
public void
actionPerformed([Link] evt) {
jButton1ActionPerformed(evt);
}
});

[Link](new [Link]("Tahoma",
0, 18)); // NOI18N
[Link]("Back");
[Link](new
[Link]() {
public void
actionPerformed([Link] evt) {
jButton2ActionPerformed(evt);
}
});

[Link] layout = new


[Link](getContentPane());
getContentPane().setLayout(layout);
[Link](
[Link].DEFAULT_SIZE,
[Link].PREFERRED_SIZE)
.addComponent(jLabel15))
.addGap(18, 18, 18)

.addGroup([Link]([Link]
[Link])
.addComponent(jButton2)
.addComponent(jButton1))
.addContainerGap(62, Short.MAX_VALUE))
);

setSize(new [Link](913, 617));


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

private void
jTextField9ActionPerformed([Link]
ent evt) {
// TODO add your handling code here:
}
private void
jButton2ActionPerformed([Link]
t evt) {
// TODO add your handling code here:
setVisible(false);
Home ob=new Home();
[Link](true);
}

private void
jButton3ActionPerformed([Link]
t evt) {
// TODO add your handling code here:
String sql="select * from issuebook where
Student_ID=?";
try{
pst=[Link](sql);
[Link](1,[Link]());
rs=[Link]();
if([Link]())
{
String add1=[Link]("SName");
[Link](add1);
String add2=[Link]("FName");
[Link](add2);
String add3=[Link]("Course");
[Link](add3);
String add4=[Link]("Branch");
[Link](add4);
String add5=[Link]("Year");
[Link](add5);
String add6=[Link]("Semester");
[Link](add6);
String add7=[Link]("Book_ID");
[Link](add7);
String add8=[Link]("Name");
[Link](add8);
String add10=[Link]("Edition");
[Link](add10);
String add11=[Link]("Publisher");
[Link](add11);
String add12=[Link]("price");
[Link](add12);
String add13=[Link]("ISBN No");
[Link](add13);
String add14=[Link]("DateOfissue");
[Link](add14);
[Link]();
[Link]();
}else{
[Link]("e");
}
}catch(Exception e)
{
[Link](e) ;
}
}

private void
jButton1ActionPerformed([Link]
t evt) {
// TODO add your handling code here:
Delete();
ReturnUpdate();
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {

/* Create and display the form */


[Link](new
Runnable() {
public void run() {
new ReturnBook().setVisible(true);
}
});
}

// Variables declaration - do not modify


private [Link] jButton1;
private [Link] jButton2;
private [Link] jButton3;
private [Link] jLabel1;
private [Link] jLabel10;
private [Link] jLabel11;
private [Link] jLabel12;
private [Link] jLabel13;
private [Link] jLabel14;
private [Link] jLabel15;
private [Link] jLabel2;
private [Link] jLabel3;
private [Link] jLabel4;
private [Link] jLabel5;
private [Link] jLabel6;
private [Link] jLabel7;
private [Link] jLabel8;
private [Link] jLabel9;
private [Link] jPanel1;
private [Link] jPanel2;
private [Link] jTextField1;
private [Link] jTextField10;
private [Link] jTextField11;
private [Link] jTextField12;
private [Link] jTextField13;
private [Link] jTextField14;
private [Link] jTextField15;
private [Link] jTextField2;
private [Link] jTextField3;
private [Link] jTextField4;
private [Link] jTextField5;
private [Link] jTextField6;
private [Link] jTextField7;
private [Link] jTextField8;
private [Link] jTextField9;
// End of variables declaration
}

You might also like