A Java + MySQL based console application for booking bus tickets. The system allows users to view available buses, check seat availability, and make bookings based on date and bus number. It uses JDBC for database operations and demonstrates key CRUD operations.
- π» Java (JDK 8+)
- π’οΈ MySQL (Database)
- π JDBC (Java Database Connectivity)
- π§ Core Java (OOP Concepts)
- π¦ Eclipse IDE (Recommended)
Bus_Reservation_System/tree/main/JDBC/src
βββ Bus_Main.java # Main class to run the project
βββ DB_Connection.java # DB connection class
βββ Bus_table.java # Handles Bus table
βββ Booking.java # Takes user input
βββ Booking_table.java # Booking logic and DB access
- π Display available buses
- π€ Book a seat with date and bus number
- π Check if a seat is available
- β Prevent overbooking by comparing capacity
- ποΈ CRUD operations on bookings
| Operation | Description |
|---|---|
| Create | Insert a new booking into booking table |
| Read | Display all buses and fetch booked count |
| Update | (Extendable) Could be added to modify Name |
| Delete | (Extendable) Could be added to cancel a Name |
| id (PK) | ac (0/1) | capacity |
|---|---|---|
| 1 | 1 | 30 |
| 2 | 0 | 45 |
| passenger_name | bus_no | travel_date |
|---|---|---|
| Sudhipth | 1 | 2025-10-11 |
------------------------------------------
Bus No: 1
AC: yes
Capacity: 30
Bus No: 2
AC: no
Capacity: 45
------------------------------------------
Enter 1 to Book and 2 to exit
1
Enter name of passenger:
Sudhipth
Enter bus no:
1
Enter date dd-mm-yyyy
11-10-2025
Your booking is confirmed
git clone https://github.com/Sudhipth/Bus_Reservation_System.git
cd Bus_Reservation_System
-
Create a database named jdbcdemo
-
Add bus and booking tables as shown above
-
Open the project in Eclipse or any Java IDE
- If you have any queries related to this project, feel free to reach out:
π§ vjsudhipth@gmail.com