Skip to content

lucasrmendonca7/inventory-management-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Inventory Management System

An inventory management system in Java using JDBC and MySQL.

Overview

This console-based inventory system provides a simple and organized way to manage products, now with database persistence using MySQL.

It allows users to:

  • Add, list, update, and remove products
  • Manage product quantities efficiently
  • Persist data using a MySQL database
  • Validate user input to prevent errors
  • Maintain a clean and modular layered architecture

Project Structure

The project is organized into packages for clarity and maintainability:

  • model
    Contains the Product class (attributes, constructors, getters/setters, toString)

  • repository
    Contains ProductRepository, responsible for database access (CRUD operations using JDBC)

  • service
    Contains InventoryService, which handles business logic and validations

  • utils
    Contains helper classes like InputUtils (safe user input handling)

  • config Contains database-related classes:

    • MySQLConnectionExample (example of JDBC connection)
    • ConnectionTest (used to test database connectivity)
  • resources
    Contains database.sql, the SQL script used to create the database schema

  • Main.java
    Main class that runs the interactive console menu


Database Setup (MySQL)

This project uses a MySQL database.

To create the database and tables:

  1. Open MySQL Workbench (or another MySQL client)
  2. Execute the SQL script located at: resources/database.sql

This script will create:

  • The inventory_db database
  • The products table with appropriate constraints (UNSIGNED, DECIMAL, etc.)

Configuration

⚠️ Important: Database credentials are not included in this repository.

You must configure your own database connection locally by providing:

  • Database URL
  • Username
  • Password

Each user must create and configure their own MySQL database and update the connection settings accordingly in the MySQLConnectionExample class, located in the config package.


Usage

  1. Clone the repository:
git clone <your-repo-url>

About

A simple Java project for managing a product inventory. Allows adding, removing, updating, and listing products using object-oriented programming concepts.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages