0% found this document useful (0 votes)
4 views

AdvSushant

The Library Management System (LMS) is a software application that automates library operations such as book management, user management, and transaction tracking. Key features include advanced search capabilities, data persistence using JDBC, a user-friendly graphical interface, and security features like role-based access control. The system is built using object-oriented programming principles and Java libraries, ensuring it is maintainable and extensible.

Uploaded by

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

AdvSushant

The Library Management System (LMS) is a software application that automates library operations such as book management, user management, and transaction tracking. Key features include advanced search capabilities, data persistence using JDBC, a user-friendly graphical interface, and security features like role-based access control. The system is built using object-oriented programming principles and Java libraries, ensuring it is maintainable and extensible.

Uploaded by

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

The Library Management System

The Library Management System (LMS) is a software application designed to


automate the management of library operations, including the cataloging of
books, user management, and transaction tracking.
Key features of the system include:
1. Book Management: The ability to add, update, delete, and search for books
using different criteria like author, genre, and publication year.
2. User Management: The system supports user registration, login
authentication, and profile management for both library patrons and staff.
3. Transaction Handling: Keeps track of borrow and return dates, overdue
fees, and history of user transactions.
4. Advanced Search Capabilities: Implements search functionality using a
variety of filters and sorting options, making it easier for users to find
specific materials.
5. Data Persistence: Utilizes JDBC (Java Database Connectivity) to store and
retrieve data from relational databases like MySQL, ensuring data integrity
and security.
6. Graphical User Interface (GUI): Provides an intuitive interface using JavaFX
or Swing, making it user-friendly and easy to navigate for both library
patrons and administrators.
7. Security Features: Includes role-based access control to ensure that only
authorized users can perform certain actions, such as adding or deleting
books.
This library management system demonstrates the application of object-oriented
programming (OOP) principles, design patterns, and Java’s rich set of libraries to
build a maintainable and extensible system
Source code :
package swing;
import java.awt.EventQueue;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.time.*;
public class swingdata extends JFrame {
private static final long serialVersionUID = 1L;
private JPanel contentPane;
private JTextField textField;
private JTextField textField_1;
private JTextField textField_2;
private JTextField textField_3;
private JTextField textField_4;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
swingdata frame = new swingdata();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}

/**
* Create the frame.
*/
public swingdata() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 937, 645);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lblNewLabel = new JLabel("Book name");
lblNewLabel.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 18));
lblNewLabel.setBounds(86, 50, 156, 36);
contentPane.add(lblNewLabel);
JLabel lblNewLabel_1 = new JLabel("Book Author Name");
lblNewLabel_1.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 20));
lblNewLabel_1.setBounds(86, 107, 213, 36);
contentPane.add(lblNewLabel_1);
JLabel lblNewLabel_2 = new JLabel("Book\t ID");
lblNewLabel_2.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 20));
lblNewLabel_2.setBounds(86, 149, 156, 42);
contentPane.add(lblNewLabel_2);
JLabel lblNewLabel_3 = new JLabel("todays date");
lblNewLabel_3.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 20));
lblNewLabel_3.setBounds(62, 201, 213, 42);
contentPane.add(lblNewLabel_3);
textField = new JTextField();
textField.setBounds(278, 50, 551, 31);
contentPane.add(textField);
textField.setColumns(10);
textField_1 = new JTextField();
textField_1.setBounds(284, 107, 544, 32);
contentPane.add(textField_1);
textField_1.setColumns(10);
textField_2 = new JTextField();
textField_2.setBounds(284, 153, 544, 31);
contentPane.add(textField_2);
textField_2.setColumns(10);
textField_3 = new JTextField();
textField_3.setEditable(false);
textField_3.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
}
});
textField_3.setBounds(284, 206, 538, 31);
contentPane.add(textField_3);
textField_3.setColumns(10);
JButton btnNewButton = new JButton("Submit and exit");
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// Get current date
LocalDate currentDate = LocalDate.now();
// Format date (optional)
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-
dd");
String id1=textField.getText();
String id2=textField_1.getText();
String id3=textField_2.getText();
String id4=textField_4.getText();
String s2 = currentDate.format(formatter);
System.out.println(id1+"\n"+id2+"\n"+id3+"\n");
try {
theQuery("insert into
libarary(book_name,Author_name,id,date_of_book,today_date) values(' "
+id1+" ' , ' "
+id2+" ' , ' "
+id3+" ' , ' "
+ s2+" ' , ' "+ id4+" ' )" );
}catch(Exception e1)
{
JOptionPane.showMessageDialog(null, e1.getMessage());
}
}
Connection conn = null;
Statement stmt = null;
public void theQuery(String query) {
try {
conn = (Connection)
DriverManager.getConnection("jdbc:mysql://localhost:3306/student", "root", "root123");
stmt=conn.createStatement();
stmt.executeUpdate(query);
JOptionPane.showMessageDialog( null,"Done Successfully");

}catch(Exception e) {
JOptionPane.showMessageDialog(null, e.getMessage());
}
}
});
btnNewButton.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 20));
btnNewButton.setBounds(86, 345, 230, 60);
contentPane.add(btnNewButton);
JButton btnNewButton_1 = new JButton("Clear");
btnNewButton_1.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 20));
btnNewButton_1.setBounds(410, 345, 165, 60);
contentPane.add(btnNewButton_1);
JLabel lblNewLabel_4 = new JLabel("Date of Books Add");
lblNewLabel_4.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 20));
lblNewLabel_4.setBounds(62, 251, 201, 31);
contentPane.add(lblNewLabel_4);

textField_4 = new JTextField();


textField_4.setBounds(284, 249, 538, 31);
contentPane.add(textField_4);
textField_4.setColumns(10);

JLabel lblNewLabel_5 = new JLabel(" LIBRARARY


MANAGEMENT");
lblNewLabel_5.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 18));
lblNewLabel_5.setBounds(51, 10, 824, 23);
contentPane.add(lblNewLabel_5);
}
}

OUTPUT

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy