This is a Core Java–based Inventory Management System that demonstrates how to manage products and sales using a layered architecture and JDBC for database interaction.
The project focuses on:
- Clean separation of concerns (DAO, Model, Utility)
- Database-driven operations using JDBC
- Real-world inventory and sales logic
- Maintainable and readable Java project structure
This is not a web application. It is a console-based Java application.
- Java (JDK 8+)
- MySQL
- JDBC (MySQL Connector/J)
- IDE: IntelliJ IDEA / Eclipse (any Java IDE)
Inventory-Management-System/
│
├── src/
│ ├── dao/
│ │ ├── ProductDAO.java # Product database operations
│ │ └── SalesDAO.java # Sales & inventory update logic
│ │
│ ├── model/
│ │ └── Product.java # Product entity / model
│ │
│ ├── util/
│ │ └── DBConnection.java # JDBC database connection utility
│ │
│ └── InventorySystem.java # Main application entry point
│
├── .gitignore
├── LICENSE
└── README.md
git clone https://github.com/iamajaykr06/Inventory-Management-System-.git
cd Inventory-Management-System-
Create database:
CREATE DATABASE inventory_db;
Create product table:
CREATE TABLE products (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
quantity INT NOT NULL,
price DOUBLE NOT NULL
);
Create sales table:
CREATE TABLE sales (
id INT AUTO_INCREMENT PRIMARY KEY,
product_id INT NOT NULL,
quantity_sold INT NOT NULL,
sale_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (product_id) REFERENCES products(id)
);
This project uses JDBC for database connectivity.
Required:
- MySQL Connector/J (JDBC Driver)
Important Note This project does not use Maven or Gradle. The JDBC driver must be manually added to the project classpath via your IDE.
- Open the project in your Java IDE
- Ensure MySQL is running
- Update database credentials in:
src/util/DBConnection.java
- Run:
InventorySystem.java
- Add products to inventory
- View available products
- Update product quantity after sales
- Record sales transactions
- JDBC-based database interaction
- Clean DAO pattern usage
- JDBC connection handling
- DAO design pattern
- SQL integration with Java
- Inventory & sales logic
- Clean Java project structuring
- This is a Core Java learning project
- No frameworks are used
- Dependency management is manual by design
Ajay Kumar