A desktop Hotel Reservation System built in Java (Swing) with an SQLite database. Guests can browse rooms, make and manage reservations, and generate a printable booking receipt; administrators can manage rooms and reservations and review a full transaction audit log.
This is an Object-Oriented Programming project that demonstrates core OOP principles together with database connectivity through JDBC.
Guest (USER)
- Sign up / sign in
- Browse and filter rooms by type
- Make a reservation with a date-picker calendar (conflict / double-booking checks)
- View, reschedule, and cancel reservations
- Generate a booking receipt (view in-app and save to a
.txtfile) - Update username and password
Administrator (ADMIN)
- Add, edit, and delete rooms
- View all reservations and change their status
- View the full transaction log (audit trail of every booking action)
| Concept | Where |
|---|---|
| Abstraction | models.Room is an abstract class with an abstract getPerks() method also interfaces that used CRUD Operations |
| Inheritance | SingleRoom, DoubleRoom, DeluxeRoom, SuiteRoom extend Room; frames extend JFrame |
| Polymorphism | Room.fromType(...) factory returns the correct subclass; getPerks() resolves at runtime |
| Encapsulation | Private fields with getters/setters (e.g. classes.UserSession, models.Room) |
| Constructors / Methods | Throughout all classes |
| Exception handling | try/catch around all JDBC and file I/O operations |
| Database connectivity | db.DatabaseManager + DAO classes using JDBC / SQLite |
src/
Main.java Application entry point
classes/UserSession.java Logged-in user session
config/DesignConfig.java UI colors, fonts, sizing
db/DatabaseManager.java Schema setup, seeding, connections
dao/ Data access + managers (Auth, Room, Reservation, User, logging)
models/ Abstract Room hierarchy (Single/Double/Deluxe/Suite)
util/ReceiptGenerator.java Booking receipt formatter
frames/ Swing UI (Login, User dashboard, Admin dashboard)
lib/ sqlite-jdbc driver (.jar)
database/hotel.db SQLite database file
src/Table.javais a local-only developer utility for resetting the database and is intentionally git-ignored.
- JDK 17 or newer (the code uses text blocks and
switchexpressions). Check with:java -version javac -version
- The bundled SQLite JDBC driver in
lib/(already included:sqlite-jdbc-3.53.1.0.jar). No internet or extra install required.
git clone https://github.com/Badoobi/HotelReservationSystem.git
cd HotelReservationSystemFrom the project root (Windows PowerShell):
$files = Get-ChildItem -Recurse -Filter *.java -Path src | ForEach-Object { '"' + $_.FullName + '"' }
cmd /c ("javac -cp `"lib\*`" -d out " + ($files -join ' '))This compiles all sources into the out/ directory.
java -cp "out;lib\*" MainOn macOS/Linux, use a colon instead of a semicolon on the classpath:
java -cp "out:lib/*" Main
On first launch the app creates the database schema (if needed) and seeds the default rooms automatically, then opens the login window.
- Create a guest account from the login screen (Create Account).
- To create an admin account, register with the password
ADMIN(development convenience — the account is granted the ADMIN role).
- Passwords are stored in plain text. This build is intended for a classroom demo only and is not hardened for production use.
- Generated receipts are written to a
receipts/folder (git-ignored).