0% found this document useful (0 votes)
149 views15 pages

Book Store Management System Project

This project report describes the development of a book store management system using MySQL and Java. The report includes: 1. An introduction describing the purpose of the bookstore management system and its basic operations. 2. A requirements analysis section outlining the software requirements including JDK, Eclipse, MySQL, and MySQL JConnector. 3. An entity relationship diagram modeling the data. 4. The source code implementing basic CRUD operations for books including adding, retrieving, updating, and deleting book details from the MySQL database.

Uploaded by

Abhijeet
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)
149 views15 pages

Book Store Management System Project

This project report describes the development of a book store management system using MySQL and Java. The report includes: 1. An introduction describing the purpose of the bookstore management system and its basic operations. 2. A requirements analysis section outlining the software requirements including JDK, Eclipse, MySQL, and MySQL JConnector. 3. An entity relationship diagram modeling the data. 4. The source code implementing basic CRUD operations for books including adding, retrieving, updating, and deleting book details from the MySQL database.

Uploaded by

Abhijeet
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

AMRUTVAHINI COLLEGE OF ENGINEERING Sangamner-422608

2021-2022

Department of Computer Engineering

CERTIFICATE
MINI PROJECT ON

“Book Store Management System”


Submitted for the Course of Third Year in Computer Engineering for the Practical

“Database Management system Laboratory”

BY

Aher Shital Sampat (3102)

Bhagwat Priti Pandurang (3110)

Under the Guidance of

Prof. A.S. Thorat


Abstract:

➢ This project report consists of various phases of developing a book store


management system using MySQL and java.
➢ Introduction part gives brief introduction about Bookshop management
system and its operations.
➢ The next part is the REQUIRMENT ANALYSIS which is concerned
with study of various requirements.
➢ The next part is on SYSTEM DESIGN, which include ER diagram.
➢ In next part source code and working model is provided.
➢ Last part is regarding CONCLUSION about above mention project.

Introduction:

This book store management system is developed using Java and


MySQL. It is built to manage basic database functions that are CREATE
RETIEVE UPDATE and DELETE in Eclipse. using Mysql Database. The
INSERT, SELECT, UPDATE and DELETE statements can be used in any
database system, because this is support by all relational database systems.
By entering book name, edition and price and after that clicking on
save button record is saved in database. System will generate ID for each book.
For searching purpose this book ID is used, one can search details of particular
book by using it's ID. In short, The system will be able to record Book details :
name,edition,price. The system will be able to retrieve the Book details :
name,edition,price. Then system will be able to Edit and Delete the Book details
: name,edition,price.
Software Requirement Specification:

➢ JDK 14.0.6 :
• The JDK is a development environment for building applications,
applets, and components using the Java programming language.
• To run this project JDK is necessary.
➢ Eclipse :
• Eclipse is an integrated development environment (IDE) used in
computer [Link] primary use is for developing Java
applications.
• This project is written in eclipse IDE and runs over it.
➢ MySQL :
• MySQL is an open sourcerelational database management system
based on SQL – Structured Query Language.
• MySQL database is necessary for running this project.
➢ MySQL Jconnector :
• MySQL provides connectivity for client applications developed in
the Java programming language with MySQL Connector/J, a driver
that implements the Java Database Connectivity (JDBC) API.
• For establishing connection between MySQL and java MySQL
connector is required.

ER Diagram:

Source Code:
import [Link];

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

import [Link];

import [Link];
import [Link];

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link].*;
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link].*;
import [Link];
import [Link];
public class JavaCrud {

private JFrame frmBookShop;


private JTextField txtbname;
private JTextField txtedition;
private JTextField txtprice;
private JTable table;
private JTextField txtbid;

/**
* Launch the application.
*/
public static void main(String[] args) {
[Link](new Runnable() {
public void run() {
try {
JavaCrud window = new JavaCrud();
[Link](true);
} catch (Exception e) {
[Link]();
}
}
});
}
/**
* Create the application.
*/
public JavaCrud() {
initialize();
Connect();
table_load();
}

Connection con;
PreparedStatement pat;
ResultSet rs;

public void Connect()


{
try {
[Link]("[Link]");
con = [Link]("jdbc:mysql://localhost:3306/JavaCrud",
"root","root");
}
catch (ClassNotFoundException ex)
{
[Link]();
}
catch (SQLException ex)
{
[Link]();
}
}

public void table_load()


{
try
{
pat = [Link]("select * from book");
rs = [Link]();
[Link]([Link](rs));
}
catch (SQLException e)
{
[Link]();
}
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frmBookShop = new JFrame();
[Link]().setForeground(new Color(0, 0, 0));
[Link](new Font("Tahoma", [Link], 30));
[Link]("Book Shop");
[Link]().setBackground(Color.LIGHT_GRAY);
[Link]().setLayout(null);

JLabel lblNewLabel = new JLabel("Book Shop");


[Link](353, 10, 194, 85);
[Link]([Link]);
[Link](new Font("Tahoma", [Link], 30));
[Link]().add(lblNewLabel);

JPanel panel = new JPanel();


[Link](new TitledBorder(null, "Registration", [Link],
[Link], null, null));
[Link](Color.LIGHT_GRAY);
[Link](29, 131, 375, 229);
[Link]().add(panel);
[Link](null);

JLabel lblNewLabel_1 = new JLabel("Book Name");


lblNewLabel_1.setFont(new Font("Tahoma", [Link], 14));
lblNewLabel_1.setBounds(38, 34, 117, 34);
[Link](lblNewLabel_1);

JLabel lblNewLabel_1_1 = new JLabel("Edition");


lblNewLabel_1_1.setFont(new Font("Tahoma", [Link], 14));
lblNewLabel_1_1.setBounds(38, 91, 104, 44);
[Link](lblNewLabel_1_1);

JLabel lblNewLabel_1_2 = new JLabel("Price");


lblNewLabel_1_2.setFont(new Font("Tahoma", [Link], 14));
lblNewLabel_1_2.setBounds(38, 145, 104, 44);
[Link](lblNewLabel_1_2);

txtbname = new JTextField();


[Link](153, 42, 212, 26);
[Link](txtbname);
[Link](10);
txtedition = new JTextField();
[Link](10);
[Link](153, 94, 212, 26);
[Link](txtedition);

txtprice = new JTextField();


[Link](10);
[Link](153, 148, 212, 26);
[Link](txtprice);

JButton btnNewButton = new JButton("Save");


[Link](new Font("Tahoma", [Link], 14));
[Link](new ActionListener() {
public void actionPerformed(ActionEvent e) {

String bname,edition,price;
bname = [Link]();
edition = [Link]();
price = [Link]();

try {
pat = [Link]("insert into book(Name,Edition,Price)values(?,?,?)");
[Link](1, bname);
[Link](2, edition);
[Link](3, price);
[Link]();
[Link](null, "Record Addedddd!!!!!");
table_load();

[Link]("");
[Link]("");
[Link]("");
[Link]();
}

catch (SQLException e1)


{

[Link]();
}
}});

[Link](29, 390, 92, 51);


[Link]().add(btnNewButton);
JButton btnExit = new JButton("Exit");
[Link](new Font("Tahoma", [Link], 14));

[Link](new ActionListener() {
public void actionPerformed(ActionEvent e) {
[Link](0);
}
});
[Link](173, 390, 92, 51);
[Link]().add(btnExit);

JButton btnClear = new JButton("Clear");


[Link](new Font("Tahoma", [Link], 14));

[Link](new ActionListener() {
public void actionPerformed(ActionEvent e) {

[Link]("");
[Link]("");
[Link]("");
[Link]();
}
});
[Link](312, 390, 92, 51);
[Link]().add(btnClear);

JScrollPane scrollPane = new JScrollPane();


[Link](427, 129, 388, 312);
[Link]().add(scrollPane);

table = new JTable();


[Link](table);

JPanel panel_1 = new JPanel();


panel_1.setBorder(new TitledBorder(null, "Search", [Link], [Link],
null, null));
panel_1.setBounds(35, 472, 369, 65);
[Link]().add(panel_1);
panel_1.setLayout(null);

JLabel lblNewLabel_2 = new JLabel("Book ID");


lblNewLabel_2.setFont(new Font("Tahoma", [Link], 14));
lblNewLabel_2.setBounds(10, 24, 106, 31);
panel_1.add(lblNewLabel_2);

txtbid = new JTextField();


[Link](10);
[Link](new KeyAdapter() {

public void keyReleased(KeyEvent e) {


try {

String id = [Link]();

pat = [Link]("select name,edition,price from book where id = ?");


[Link](1, id);
ResultSet rs = [Link]();

if([Link]()==true)
{

String name = [Link](1);


String edition = [Link](2);
String price = [Link](3);

[Link](name);
[Link](edition);
[Link](price);

}
else
{
[Link]("");
[Link]("");
[Link]("");

}
}
catch (SQLException ex) {

}
}});

[Link](147, 29, 212, 26);


panel_1.add(txtbid);
JButton btnUpdate = new JButton("Update");
[Link](new ActionListener() {
public void actionPerformed(ActionEvent e)
{
String bname,edition,price,bid;
bname = [Link]();
edition = [Link]();
price = [Link]();
bid = [Link]();
try {
pat = [Link]("update book set name= ?,edition=?,price=? where
id =?");
[Link](1, bname);
[Link](2, edition);
[Link](3, price);
[Link](4, bid);
[Link]();
[Link](null, "Record Updatedddd!!!!!");
table_load();

[Link]("");
[Link]("");
[Link]("");
[Link]();
}

catch (SQLException e1)


{

[Link]();
}
}});
[Link](new Font("Tahoma", [Link], 14));
[Link](476, 472, 128, 65);
[Link]().add(btnUpdate);

JButton btnDelete = new JButton("Delete");


[Link](new Font("Tahoma", [Link], 14));

[Link](new ActionListener() {

public void actionPerformed(ActionEvent e) {

String bid;
bid = [Link]();

try {
pat = [Link]("delete from book where id =?");

[Link](1, bid);
[Link]();
[Link](null, "Record Delete!!!!!");
table_load();

[Link]("");
[Link]("");
[Link]("");
[Link]();
}

catch (SQLException e1) {

[Link]();
}
}});

[Link](648, 472, 128, 65);


[Link]().add(btnDelete);

[Link](100, 100, 859, 584);


[Link](JFrame.EXIT_ON_CLOSE);
}}
Working model:

Adding a Record:
Updating a Record:
Deleting a Record:

Conclusion:

The goal of Book Store management system is to offer more convenience and
more efficiency to access data from database.
Achievements :
➢ Database design.
➢ Understanding connectivity between java and MySQL.
➢ Performing CRUD operations.

Common questions

Powered by AI

The system uses prepared statements within action listeners for buttons handling save, update, and delete functions. Each operation is followed by a user notification via dialogs (e.g., JOptionPane) to confirm successful execution. The 'table_load()' method refreshes the displayed data to reflect changes, ensuring the UI stays consistent with the actual database state .

Event-driven programming allows the system to respond to user actions through event listeners tied to UI components such as buttons and text fields. For instance, action listeners detect button presses to execute corresponding database operations, enabling interactive and responsive user experiences .

Developers might face challenges such as ensuring data consistency between the UI and backend, managing user input validation, and handling concurrency issues when multiple users interact simultaneously. These can be overcome by implementing MVC design pattern to separate concerns, using data binding techniques for UI updates, and leveraging synchronization and transaction management for concurrency control .

The current implementation lacks error handling and transaction management, leading to potential data inconsistency. Improvements could include implementing input validation, enhancing error handling to manage SQL exceptions more gracefully, and incorporating transaction management to ensure database integrity across multiple operations. Additionally, introducing user authentication and access control would enhance security .

The system utilizes Java's JDBC API to establish a connection with a MySQL database using the MySQL Connector/J driver. The main operations—INSERT, SELECT, UPDATE, and DELETE—are conducted through prepared statements within Java methods. The application initializes a connection in the 'Connect()' method and executes SQL queries to interact with the database, using Java GUI components for user input .

Prepared statements are used to execute database queries more efficiently and securely by pre-compiling SQL commands and allowing parameters to be dynamically set at runtime. This prevents SQL injection attacks and improves performance by reusing execution plans. The project leverages prepared statements for operations like adding, updating, and deleting records .

The software requirements include JDK 14.0.6 for Java development, Eclipse as the integrated development environment for coding, MySQL as the relational database management system, and MySQL Jconnector for Java-MySQL connectivity through JDBC API .

The system's user interface is designed using Java's Swing components, including JTextFields for entering book details and JButtons for executing operations like save, update, and delete. User inputs in the text fields are handled by action listeners attached to these buttons, allowing interaction with the database through prepared statements .

The ER diagram models the entities and relationships within the bookstore system, providing a logical framework for database structure and guiding table creation. It outlines attributes like book name, edition, and price, establishing primary keys and necessary links, which simplifies the transition to SQL database implementation .

The Book Store Management System provides functionalities that include recording book details such as name, edition, and price, retrieving these details using the book ID, and allowing users to edit and delete book records. These functionalities are achieved using basic database operations like CREATE, RETRIEVE, UPDATE, and DELETE, facilitated through Java and MySQL .

You might also like