Skip to content

Sudhipth/Bus_Reservation_System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🚌 Bus Reservation System

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.


πŸ”§ Technologies Used

  • πŸ’» Java (JDK 8+)
  • πŸ›’οΈ MySQL (Database)
  • πŸ”— JDBC (Java Database Connectivity)
  • 🧠 Core Java (OOP Concepts)
  • πŸ“¦ Eclipse IDE (Recommended)

πŸ“‚ Project Structure

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


πŸ“Œ Features

  • 🚍 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

πŸ”„ CRUD Operations Used

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

πŸ—ƒοΈ Database Tables

bus

id (PK) ac (0/1) capacity
1 1 30
2 0 45

booking

passenger_name bus_no travel_date
Sudhipth 1 2025-10-11

βœ… Example Input & Output

------------------------------------------
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

▢️ How to Run

πŸ“₯ Clone the Repository

git clone https://github.com/Sudhipth/Bus_Reservation_System.git
cd Bus_Reservation_System

πŸ› οΈ Setup MySQL

  • Create a database named jdbcdemo

  • Add bus and booking tables as shown above


πŸš€ Run the Application

  • Open the project in Eclipse or any Java IDE

  • Run the Bus_Main.java file


πŸ“¬ Contact

  • If you have any queries related to this project, feel free to reach out:
πŸ“§ vjsudhipth@gmail.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages