A fully-featured Hotel Reservation System built with Java, MySQL, JDBC, and the DAO design pattern. Supports complete hotel operations including room management, customer registration, booking, check-in/check-out, payment simulation, and analytics reporting.
| Feature | Description |
|---|---|
| ποΈ Room Management | View all/available rooms, search by category (Standard/Deluxe/Suite) |
| π€ Customer Management | Register guests, search by email/ID, view history |
| π Reservation Management | Book, cancel, check-in, check-out |
| π³ Payment Simulation | Cash, Credit Card, Debit Card, Online β with transaction IDs |
| π Reports & Analytics | Revenue, occupancy stats, reservation summaries |
| π¨ Colored Console UI | Beautiful ANSI-colored terminal interface |
CodeAlpha_HotelReservation/
βββ src/main/java/com/codealpha/hotel/
β βββ Main.java β Entry point
β βββ config/
β β βββ DatabaseConfig.java β Singleton DB connection
β βββ model/
β β βββ Room.java β Room entity (with RoomCategory enum)
β β βββ Customer.java β Customer entity
β β βββ Reservation.java β Reservation entity (with status enum)
β β βββ Payment.java β Payment entity (with method/status enums)
β βββ dao/
β β βββ RoomDAO.java β Room DAO interface
β β βββ CustomerDAO.java β Customer DAO interface
β β βββ ReservationDAO.java β Reservation DAO interface
β β βββ PaymentDAO.java β Payment DAO interface
β β βββ impl/
β β βββ RoomDAOImpl.java β JDBC implementation
β β βββ CustomerDAOImpl.java β JDBC implementation
β β βββ ReservationDAOImpl.java β JDBC implementation
β β βββ PaymentDAOImpl.java β JDBC implementation
β βββ service/
β β βββ HotelService.java β Business logic layer
β βββ ui/
β βββ ConsoleUI.java β Full ANSI console interface
βββ src/main/resources/
β βββ database.properties β DB credentials
βββ sql/
β βββ hotel_db.sql β Database schema + sample data
βββ pom.xml β Maven config (MySQL connector)
βββ README.md
- Java 11+ β Core language
- MySQL 8.x β Database
- JDBC β
java.sqlfor database connectivity - DAO Pattern β Interface + Implementation separation
- Maven β Dependency management (auto-downloads MySQL connector)
- OOP β Encapsulation, abstraction, singleton pattern
- ANSI Colors β Beautiful console UI
- JDK 11 or higher
- MySQL 8.x installed and running
- Maven installed (or use VS Code Java Extension Pack)
-- In MySQL Workbench or terminal: mysql -u root -p < sql/hotel_db.sql
Edit src/main/resources/database.properties:
db.url=jdbc:mysql://localhost:3306/hotel_db?useSSL=false&serverTimezone=UTC db.username=root db.password=YOUR_PASSWORD_HERE
mvn compile exec:java -Dexec.mainClass="com.codealpha.hotel.Main"- Open project in VS Code
- Install Extension Pack for Java
- Open
Main.javaβ Click βΆ Run
MAIN MENU
βββ [1] Room Management
β βββ View All Rooms
β βββ View Available Rooms
β βββ Search by Category
β βββ View Room Details
βββ [2] Customer Management
β βββ Register Customer
β βββ View All Customers
β βββ Search by Email
β βββ View by ID
βββ [3] Reservation Management
β βββ Book a Room β validates availability
β βββ Cancel Reservation β auto-refund
β βββ Check-In Guest
β βββ Check-Out Guest
β βββ View All Reservations
β βββ View Details
β βββ View by Customer
βββ [4] Payment Management
β βββ Process Payment (Cash/Card/Online)
β βββ View All Payments
βββ [5] Reports & Analytics
βββ Revenue, occupancy, reservation stats
4 tables: rooms, customers, reservations, payments β with foreign key relationships and 11 pre-loaded sample rooms (Standard/Deluxe/Suite).
- Name: Niha Hawas
- Internship: CodeAlpha β Java Programming Task 4
- GitHub: https://github.com/nihahawas
Educational project for CodeAlpha Java Internship Program.