Skip to content

Vidhathri24-droid/HotelManagementSystem-Java-Project-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hotel Management System - Java Swing + MySQL

This is a Hotel Management System built using Java Swing for the GUI and MySQL for backend database operations. The system is modular and includes functionality for customer registration, booking, billing, and service management.

📦 Project Structure

.
├── Driver.java               # Main entry point to launch the application
├── gui/                     # Contains all GUI classes (Signup, Login, Dashboards)
└── service/                 # Service classes handling business logic and database access

Technologies Used

  • Java (JDK 8+)
  • Java Swing (GUI)
  • MySQL (Database)
  • JDBC (Database Connectivity)

Features

  • User registration and login
  • Customer and admin dashboards
  • Booking and billing services
  • Room management
  • Responsive GUI forms using Swing

How to Run

  1. Clone or download this repository.
  2. Import the project into your IDE (like IntelliJ IDEA or Eclipse).
  3. Set up the MySQL database (see below).
  4. Update the DB credentials in the DatabaseUtil class.
  5. Compile and run Driver.java.

MySQL Setup

Run the following SQL commands in your MySQL environment:

CREATE DATABASE hotel_db;
USE hotel_db;

CREATE TABLE users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(50) NOT NULL UNIQUE,
    password VARCHAR(100) NOT NULL,
    role VARCHAR(20) DEFAULT 'customer'
);

CREATE TABLE rooms (
    id INT AUTO_INCREMENT PRIMARY KEY,
    branch_id INT NOT NULL,
    room_type VARCHAR(50) NOT NULL,
    price DECIMAL(10,2) NOT NULL,
    is_available TINYINT(1) DEFAULT 1,
    FOREIGN KEY (branch_id) REFERENCES branches(id)
);

CREATE TABLE bookings (
    id INT AUTO_INCREMENT PRIMARY KEY,
    user_id INT NOT NULL,
    room_id INT NOT NULL,
    checkin_date DATE NOT NULL,
    checkout_date DATE NOT NULL,
    total_cost DECIMAL(10,2) NOT NULL,
    FOREIGN KEY (user_id) REFERENCES users(id),
    FOREIGN KEY (room_id) REFERENCES rooms(id)
);

CREATE TABLE guests (
    id INT AUTO_INCREMENT PRIMARY KEY,
    booking_id INT NOT NULL,
    name VARCHAR(100) NOT NULL,
    FOREIGN KEY (booking_id) REFERENCES bookings(id)
);

CREATE TABLE hotel_branches (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    location VARCHAR(100)
);

🔐 Sample Credentials

  • Admin:

    • Username: admin
    • Password: admin123
  • Customer:

    • Register via the Signup form

Notes

  • Make sure MySQL is running and accessible on your machine.
  • Modify DatabaseUtil.java to match your DB username, password, and URL.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages