Vehicle Service Booking System is a Java console app using MySQL to manage vehicle service bookings. It supports adding, viewing, updating, deleting, and searching bookings, with real-time DB sync, filtering, and an interactive menu, demonstrating Java, JDBC, and OOP skills.
A console-based Java application to manage vehicle service bookings.
It allows users to add, view, update, search, filter, and delete service bookings, storing the data both in memory and in a MySQL database.
- Add new vehicle service bookings with details like vehicle, owner, service type, and date.
- View all bookings or search bookings by ID, owner name, phone number, or vehicle registration number.
- Update booking details or change the booking status (Scheduled, In Service, Completed, Cancelled).
- Filter bookings by status.
- Delete bookings by ID.
- Data persistence using MySQL database while keeping in-memory backup.
-
Create
config.properties-
Copy the example config file:
cp config.properties.example config.properties(If you are on Windows, just make a copy manually and rename it to
config.properties) -
Open
config.propertiesand replace the placeholders with your database credentials:db.url=jdbc:mysql://localhost:3306/your_db_name db.user=your_db_user db.password=your_db_password
-
-
Compile and Run the Program
- Open a terminal in the project folder.
- Compile all Java files:
javac *.java - Run the main program:
java Main
-
Database Setup
-
Make sure MySQL is running and a database exists with a table named
userswith the following schema:CREATE TABLE users ( booking_id INT PRIMARY KEY, reg_no VARCHAR(20), model VARCHAR(50), owner_name VARCHAR(100), phone VARCHAR(20), address VARCHAR(255), service_type VARCHAR(50), date VARCHAR(20), status VARCHAR(20) );
-
- Run the program using
java Main. - Use the menu options to perform operations:
- Add new bookings.
- View all bookings or specific bookings by ID.
- Update details or status of bookings.
- Search bookings by owner, phone, or registration number.
- Filter bookings by status.
- Delete bookings if required.
- Enter the number corresponding to the menu choice and follow prompts.
This project is open for personal and educational use. Add your preferred license here if needed.