Oop PBL PPT
Oop PBL PPT
MANAGEMENT
SYSTEM
By
K.Rishik
Reddy(23R11A05X1)
T.Shiva Sai (22R11A05Y5)
K.Jesdas(23R11A05W8)
ABSTRA
•CT
The Store Management System (SMS) is a comprehensive software solution designed to
streamline the operations of retail stores by automating key processes such as inventory
management, sales tracking, customer management, and order processing. This system
provides an intuitive interface for store owners and employees to efficiently monitor stock
levels, manage product catalogs, track sales transactions, and generate real-time reports.
With features like barcode scanning, automated stock alerts, and detailed sales analytics,
the SMS enhances operational efficiency, reduces human error, and improves customer
service. The system also supports various payment methods, including cash, credit/debit
cards, and online transactions, ensuring a seamless and secure checkout process.
Additionally, the SMS can be customized to fit the specific needs of different types of
stores, making it a versatile tool for small, medium, and large retail businesses. Ultimately,
the Store Management System aims to improve inventory control, optimize resource
allocation, and boost profitability by providing data-driven insights for better decision-
making.
Java swing:
1. import Statements:
import java.sql.*;: This statement imports classes from the java.sql package, which contains classes
necessary for database interaction, such as Connection, Statement, PreparedStatement, ResultSet, etc.
import java.util.Scanner;: This imports the Scanner class, used for reading user input from the console.
2. Connection:
Represents a connection to a specific database. This is used to send SQL queries to the database and
manage the connection lifecycle.
3. DriverManager:
This is used to manage a list of database drivers and establish a connection to a database using the
appropriate driver.
4. PreparedStatement:
A subclass of Statement, PreparedStatement is used to execute SQL queries that are precompiled and
can be executed multiple times with different parameters. It helps prevent SQL injection attacks and
enhances performance.
5. Statement:
This is used to execute basic SQL queries like SELECT, INSERT, UPDATE, or DELETE without
parameters.
6. SQLException:
A specific type of exception thrown when an error occurs during database access or SQL operations .
7. ResultSet:
Represents the result of a query execution. It holds the data retrieved from a database (e.g., rows returned by a
SELECT query).
8. next():
A method of ResultSet that moves the cursor to the next row. It returns true if there is a next row available,
otherwise false.
9. System.out.println():
This method prints output to the console. It is commonly used for debugging or interacting with the user in
console applications.
10. Scanner:
A class used for reading user input. In this case, it is used to capture the user's menu choice, product name,
price, and quantity.
11. try-with-resources:
This feature, introduced in Java 7, ensures that resources (like Connection, Statement, PreparedStatement,
ResultSet, etc.) are automatically closed when the block is exited, either due to normal execution or an exception.
12. switch Statement:
A control flow statement that executes one of many possible code blocks based on a variable's value.
13. int, double, String:
These are basic data types used to define variables. int is for integers, double for floating-point numbers (used for
product prices), and String for text (used for product names).
14. SQL Commands:
INSERT INTO: This SQL statement is used to insert new records into a table.
UPDATE: Used to modify existing records in a table.
DELETE: Deletes records from a table.
SELECT: Retrieves data from a table.
15. rowsAffected:
A variable used to store the number of rows affected by an INSERT, UPDATE, or DELETE query. This helps
determine if the operation was successful.
Java Database Connectivity (JDBC):
•The code uses JDBC to interact with a MySQL database. Specifically, the following are key points:
•Connecting to Database: DriverManager.getConnection is used to establish a connection to
the MySQL database (online_store).
•Prepared Statements: Queries like SELECT, INSERT, and UPDATE are executed using
PreparedStatement objects to interact with the database safely.
•ResultSet: The code uses ResultSet to retrieve data from the database and process it (e.g.,
fetching user roles, product details).
•SQL exceptions are caught and printed using SQLException.
•Exception Handling:
Error Handling:The code employs try-catch blocks for error handling, particularly for SQL operations
and UI actions.
DBMS Principles Used (SQL):
Relational database management concepts:
The system uses relational database management concepts,
with tables for Customers, Products, and Orders designed using
SQL
• DDL commands:
DDL (Data Definition Language) is used to define the
structure of the database
• DML commands:
DML (Data Manipulation Language) operations are used to
manage the data.
SOFTWARE
REQUIREMENTS
1.Java Development Kit (JDK)
Version: JDK 8 or higher (preferably the latest stable
version)
Description: Required to compile and run Java
applications.
2.Integrated Development
Environment (IDE) Examples:
Eclipse
IntelliJ IDEA
3.Database Management System
(DBMS) MySQL Server:
Version: MySQL 5.7 or higher
• MySQL Connector/J
• Description:
A JDBC driver for connecting Java applications to MySQL
databases.
• Version:
Latest stable version.
WORKING AND FEATURES OF STORE MANAGEMENT
SYSTEM
•Add, Update, Remove, and View Products: Manage store products with options to add, modify, delete, and
display product details.
•Database Integration: Uses JDBC to interact with a MySQL database for storing product information.
•Menu-Driven Interface: Simple console interface with a user-friendly menu to select operations.
•Secure Database Operations: Implements secure SQL queries (INSERT, UPDATE, DELETE, SELECT) to prevent SQL injection.
•Error Handling: Catches and displays errors related to database operations.
•Scalable: Can handle large product inventories and data retrieval.
•Resource Management: Utilizes try-with-resources to manage database connections efficiently.
•Extensible: Can be enhanced with additional features like inventory tracking or reporting.
Conclusion
This Store Management System is an essential tool for small businesses or stores to
manage their inventory effectively. By leveraging database interaction with MySQL, it
provides an organized and scalable solution for managing product data. The system is easy
to use with a console-based menu, and it supports critical functions such as adding,
updating, viewing, and deleting products while maintaining database consistency and
security.
JAVA SOURCE CODE