Skip to content

Latest commit

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🍽️ Restaurant Management System (Java + JDBC + MySQL)

A simple Java console application to manage restaurant records using JDBC and MySQL. It supports basic CRUD operations with a clean multi-layered architecture.


📁 Project Structure

RestaurantProject/
├── build.bat
├── README.md
│
├── lib/
│ ├── mysql-connector-java-8.0.xx.jar
│ ├── log4j-api-2.x.jar
│ └── log4j-core-2.x.jar
│
├── resources/
│ └── log4j2.xml
│
├── logs/
│ └── app.log
│
├── src/
│ └── RestaurantProject/
│ ├── model/
│ │ ├── Restaurant.java
│ │ ├── Customer.java
│ │ ├── Employee.java
│ │ ├── Menu.java
│ │ ├── Order.java
│ │ ├── PaymentTransaction.java
│ │ └── CustomerReview.java
│ ├── repository/
│ │ └── RestaurantRepo.java
│ ├── service/
│ │ └── RestaurantService.java
│ ├── util/
│ │ └── RestaurantConstants.java
│ └── Main.java
│
├── bin/

📄 File Descriptions

  • build.bat – Batch script to compile all Java files and run the program.
  • README.md – Project documentation and usage guide.

lib/

  • mysql-connector-j-9.x.x.jar – MySQL JDBC driver for database connectivity.
  • log4j-api-2.x.x.jar – Log4j 2 API for logging.
  • log4j-core-2.x.x.jar – Log4j 2 Core implementation.

resources/

  • log4j2.xml – Configuration file for Log4j 2 logging.

logs/

  • app.log - Generated runtime log file.

src/RestaurantProject/

model/

  • Restaurant.java – POJO class for restaurant entity.
  • Customer.java – POJO representing customer details.
  • Employee.java – POJO representing employee data.
  • Menu.java – POJO for menu items.
  • Order.java – POJO representing customer orders.
  • PaymentTransaction.java – POJO for payment transaction details.
  • CustomerReview.java – POJO for customer reviews and ratings.

repository/

  • RestaurantRepo.java – Contains JDBC code to interact with the restaurant database (CRUD operations).

service/

  • RestaurantService.java – Business logic layer that calls repository functions and provides service-level operations.

util/

  • RestaurantConstants.java – Stores constants like DB URL, username, password, and JDBC driver class.

Main.java

  • Entry point of the application; contains the main() method for running the program and testing service methods.

bin/

  • Compiled class files

🗂️ Database Schema

Database Schema


🛠️ Setup Instructions

  1. Install MySQL and create a restaurant database.
  2. Add your DB credentials to util/RestaurantConstants.java.
  3. Place the MySQL JDBC driver .jar file in the lib/ folder.
  4. Run build.bat to compile and execute the application.

💡 Make sure Java is added to your system PATH.


✅ Features

Restaurant

  • Get all restaurants
  • Get restaurant by ID
  • Create a new restaurant
  • Delete restaurant by ID or by ID + Name
  • Update restaurant by ID
  • Update GST number by restaurant type

📦 Technologies Used

  • Java 8+
  • JDBC
  • MySQL
  • MySQL Connector/J (JDBC Driver)
  • Apache Log4j2 for logging

🧠 Example Usage (in Main.java)

List<Restaurant> list = RestaurantService.getRestaurants();
RestaurantnewRestaurant = newRestaurant();
newRestaurant.setName("Spice Villa");
newRestaurant.setLocation("Hyderabad");
newRestaurant.setGstNo("GST1234");
newRestaurant.setDate("2020-01-01");
RestaurantService.createRestaurant(newRestaurant);

🙌 Author

Developed by Rajeev Telagasetti. Feel free to fork, use, or contribute to this project!

About

A Java-based console application for managing restaurant data using JDBC and MySQL. It follows a clean, layered architecture with model, repository, and service components. Easily performs CRUD operations on restaurant records through simple Java methods.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages