0 ratings0% found this document useful (0 votes) 51 views25 pagesImage To PDF 20231211 16.03.22
their was telephone billing system code
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
ST. THOMAS ACADEMY
PROJECT FILE
Of 12" CLASS SESSION 2021-22
TOPIC: Hospital Management System
SUBMITTED BY: SUBMITTED TO:
MOHD. NOMAAN MRS, SONIA KHANIJA ~
CLASS 12™ (SCIENCE)ACKNOWLEDGMENT
| WISH to express our sincere thanx to Mrs. PRIYA MALIK
principal,ST. THOMAS ACADEMY,
| wish to express our deep and profound sense of gratitude to
our Subject teacher MRS. Sonia Khanija for her
expert help and valuable guidance, comments and
suggestions. | also place on record, our sincere gratitude to
one and all who directly or indirectly have lent their helping
hand in completion of this project file.
Nitin dhiman
a
12" COMMERCECERTIFICATE
| Certify that ISHA GROVER a student of class,12
COMMERCE has worked under my guidance and
supervision of Mrs. SONIA KHANIJA subject teacher
during the year 2023-24 in practical of
INFORMATION TECHNOLOGY examination
conducted by our school ST. THOMAS ACADEMY
Saharanpur, U.P.
INTERNAL SIGNATURE EXTERNAL
SIGNATUREINTRODUCTION
In this article, we will build Library
Management System Project in Java and
MySQL with source code. This project is
great for those at an intermediate level in
Java who want to advance their coding
skills. In this project, the users will be able
functionalities Login, View Categories, Book
detaiis, Author details, Book issue, and Book
return. Let’s get started!Project Name: Library Management System Project in Java
It’s a GUI-based project used with the Swing module
to organize all the elements that work under library
Abstract management.
Language/s Used: Java
IntelliJ Idea Professional(Recommended)
Python version
(Recommended): | Java SE 18.0. 2.1
{ MySQL
Desktop Application
Database:
Type:
Recommended for Final Year Students«+
.
eV vuyue VeuuuHoeee
SETTING THE DEVELOPMENT
ENVIRONMENT
You must have java JDK installed on your system and we are
using Eclipse IDE to build this project. you can use either this or
Netbeans IDE
The first step will be to create a new project Name it as you
wish. In the src folder create a library package In that package
we will be creating some files for different modules
To connect the system with the database you will need to follow
certain steps
+ Have Java JDK already installed and an |DE like Eclipse
+ Install MySQL on the system
+ Download MySQL connector from
In Eclipse, under your project expand external libraries and
right-click. and select Open Library Settings Select the
libraries tab and click on the + button Browse your jar file
downloaded from the above siep and ciick on it This will
add a dependency to your project. The steps will differ ¢
you are using a different IDEOe STEVE YC EH
1. Create a database
+ Creating database
create database
2. Select the database
p Li
3. Create a book table
set
crea
id t
book _n
catego
author varcinsert
("admi
("admin2",vo
v
1, LOGIN MODULE IN LIBRARY
MANAGEMENT SYSTEM PROJECT IN
JARYR
This module helps to make a login page so that the user can
enter the user name and Password to enter into the library
Management system in Java.
package library;
import javax.swing.}
public class Login extends javax.swing.JFrame {
public Login() {
initComponents();
}
@SuppressWarnings("unchecked")
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jPanell = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
txtusername = new javax.swing.JTextField();
txtpass = new javax.swing.JPasswordField();6 e © &
Vv Vvreovwvwwevueuveuvueesesse
jButton2 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXI
T_ON_CLOSE);
jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 36));
jLabel1.setText("Library Login");
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBor
der("Login"));
jlabel2.setText("Username");
jlabel3.setText("Password");
javax.swing.GroupLayout jPaneliLayout = new
javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroun(javax.swing.GroupLayout.
Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(48, 48, 48)vw w& & &
»
wv
-addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gr
oupLayout.Alignment.LEADING)
-addComponent(jLabel3))
-addGap(51, 51, 51)
-addGroup(jPanel1 Layout.createParallelGroup(javax.swing.Gr
oupLlayout Aligniment. TRAILING, faise)
-addGroup(jPanel1Layout.createSequentialGroup()
-addGap(4, 4, 4)
.addComponent(txtpass))
.addComponent(txtusername,
javax.swing.GroupLayout.PREFERRED SIZE, 161,
javax.swing.GroupLayout.PREFERRED_SIZE))
-addContainerGap(114, Short. MAX_VALUE))
);
jPaneliLayout.setVerticalGroup(
jPaneliiayout.createParailelGroup(javax.swing.GroupLayout.
Alignment.LEADING)>
eve eu
.
-addGroup(javax.swing.GroupLayout.Alignment. TRAILING,
jPanel1Layout.createSequentialGroup()
.addGan(33, 33, 33)
-addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gr
oupLayout.Alignment.BASELINE)
-addComponent(jLabel2)
addComponent(txtusername,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing. Sroupiayeti DEFAULT_SIZE,
jevax.swin,
nm
.addGap(43, 43, 43)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Gr
oupLayout.Alignment.TRAILING)
.addComponent(jiabei3)
.addComponent(txtpass,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
addContainerGan/31, Short. MAX VALUE}
);
eeeoe ©
weevuwewt ve eusu
jButton2.setText("Cancel");
jButton2.addActionListener(new
java.awt.event.ActionListener() {
public void
actionPerformed(java.awt.event.ActionEvent evt) {
iButton2ActionPerformed(evt);
}
);
jButton1.setText("Login");
jButton1.addActionListener(new
java.awt.event.ActionListener() {
public void
actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
);
javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);ee ee ee
layout.createParallelGroup(javax.swing.GroupLayout.Alignme
nt. LEADING)
.addGroup(layout.createSequentialG roup()
-addGap(31, 31, 31)
-addGroup(layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.-addComponent(jLabe!1)
.addGroup(layout.createParallelGroup(javax.swing.GroupLay
out.Alignment. TRAILING)
.addGroup(layout.createSequentialGroup()
addComponeni(jBuiioni,
javax.swing.GroupLayout.PREFERRED_SIZE, 115,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlace
ment.UNRELATED)
.addComponent(jButton2,
javax.swing.GroupLayout.PREFERRED_SIZE, 126,
javax. swing Grouplayout PREFERRED SIZE)
.addGap(4, 4, 4))ov
oe
3
-addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))
-addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short. MAX_VALUE})
);
layout.setVerticalGroup(
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLay
.addGroup(javax.swing.GroupLayout.Alignment. TRAILING,
layout.createSequentialGroup()wo & “
ss &
eevwvwv eves se
v
-addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(64, 64, 64))
-addGroup(javax.swing.GroupLayout.Alignment. TRAILING,
layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
adaComponeni(jButtonZ,
javax.swing.GroupLayout.PREFERRED_SIZE, 45,
javax.swing.GroupLayout.PREFERRED_ SIZE)
.addComponent(jButton1,
javax.swing.GroupLayout.PREFERRED_SIZE, 45,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())))
);
private void
jButton1ActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_jButton1ActionPerformed
String username = txtusername.getText();ua &
we &
es vv vv vYvDo w& ws
”
0
String pass = txtpass.getText();
if(username.equals("Peter") && pass.equals("123"))
{
Main m = new Main();
this.hide();
m.setVisible(true);
wMiessageDiaiog(this, "Username and
txtusername.setText("");
txtpass.setText("");
txtusername.requestFocus();When the entered user name and password didn’t match the
existing records in the database, it will return the “Username
and password do not match’.
Meroe as
oe Shemane mePaccmert int
fey
Once we enter the correct username and password it takes us
to the home page o ‘ary Management application.oe & «&
ws
YY @PevevMYeUY UYU & &
wwWrIermnr znd
2. CATEGORY MODULE IN LIBRAR
MANAGEMENT SYSTEM IN JAVA
We can create a new category in this module by giving the
details.
package library;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sq|.SQLException;
import java.util. Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
public class category extends javax.swing.JFrame {
public category() {
initComponents();o ©
4
6
VPesebekhuseeEUUseseUEUeHE
Connect();
table_update();
}
Connection con;
PreparedStatement pst;
private void initComponents() {
jPanel2 = new javax.swing.JPanel();
jLabel9 = new javax.swing.JLabel();
jlabel10 = new javax.swing.JLabel();
ixicat = new javax.swing.JTextFieid();
txtstatus = new javax.swing. JComboBox<>();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jButton4 = new javax.swing.JButton();
jlabel1 = new javax.swing.JLabel();VP OFEKL HH KHYY DYESS
@
oe & &
setDefaultCloseOperation (javax.swing.WindowConstants. EX!
T_ON_CLOSE);
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBor
der(null, "Category",
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
javax.swing.border.TitledBorder.DEFAULT_POSITION, new
java.awt.Font("Tahoma", 1, 14)));
jlabel9.setText("Category");
jlabel10.setText("Status");
uxtstatus.setModel(new
javax.swing.DefaultComboBoxModel<>(new String[] {
"Active", "DeActive" }));
jButton1.setText("Add");
jButton1.addActionListener(new
nt Action! ictenert) {
ava.awt.event.Action Listener) {
public void
actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
Ds
jButton2.setText("Edit");5
ek eS CO OO CU OE CO OOS
& @
v
ade
iButton2.addAction|istener(new
java.awt.event.ActionListener() {
public void
actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
);
jButton3.setText("Delete");
jButton3.addActionListener(new
java.awt.event.ActionListener() {
public void
actionPerformed(java.awt.event.ActionEvent evt) {
»;
jTable1.setModel(new
javax.swing.table.DefaultTableModel(
new Object [][] {
1,
new String [] {
"Id", "Category", "Status"«oe
G
Gee¢ed
PHOoebLHHLHEVUEUUEG
vd
}
yf
Class[] types = new Class [] {
Java.lang.Integer.class, java.lang.String.class,
Java.lang.String.class
i
public Class getColumnClass(int columnindex) {
return tynes [columnindex];
}
);
jTable1.setCursor(new
java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
jTable1.setGridColor(new java.awt.Color(255, 255, 255));
jTable1.addMouseListener(new
java.awt.event.MouseAdanter() {
public void mouseClicked(java.awt.event.MouseEvent
evt) {
jTable1MouseClicked(evt);
}
Ds
jScrollPane1.setViewportView(jTable1);jButton4.addActionListener(new
java.awt.event.ActionListener() {
Public void
actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt),
y:
javax.swing.GroupLayout jPanel2Layout = new
javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.
Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(26, 26, 26)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.Gr
oupLayout.Alignment.TRAILING)
.addGroup(jPanel2Layout.createSequentialGroup()ad @& €
“
-
Ve eueoeeueuueuss
-addGroup(jPanel2Layout.createParallelGroup(javax.swing.Gr
OupLayout.Alignment.LEADING)
.addComponent(jLabei9)
.addComponent(jLabel10))
addGap(35, 35, 35)
-addGroup(jPanel2Layout.create ParallelGroup(javax.swing.Gr
Oupiayout.Alignment.LEADING)
-addComponent(txtstatus,
javax.swing.GroupLayout.PREFERRED SIZE, 153,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtcat,
rouplavout PREFERRED cize tes
roupLayout.PREFERRED_SIZE, 153,
roupLayout.PREFERRED_SIZE)))
aa
o
'o
Javax.swing.
-addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jButton1,
javax.swing.GroupLayout.PREFERRFD_SIZE, 75,
javax.swing.GroupLayout.PREFERRED_SIZE)
addPreferredGa pijavax.swing. LayoutStyle.ComponentPlace
ment.UNRELATED)