Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hostel Database Mini Web App

Minimal Java Servlet/JSP application for COMP 351 Activity 2:

  • simple interface for insert/update/delete
  • basic role-based access control (Admin/Custodian)
  • database-backed records view for demonstration

Tech Stack

  • Java 11
  • Maven (WAR project)
  • Jakarta EE 10 (Servlet/JSP)
  • MySQL 8+
  • Apache Tomcat 10.1+

Project Setup

1) Create the database schema

Run these SQL files in MySQL Workbench (in order):

  1. src/main/resources/database/schema.sql
  2. src/main/resources/database/sample_data.sql

Optional security evidence script:

  • sql/activity2_security_setup.sql (only if your MySQL account can create users/grants)

2) Configure local DB connection

  1. Copy src/main/resources/db.properties.example to src/main/resources/db.properties
  2. Put your real MySQL credentials in db.properties

db.properties is gitignored and should not be committed.

3) Build and run

Build:

mvn clean package -DskipTests

Deploy:

  • Deploy target/hostel-1.0-SNAPSHOT.war to Tomcat 10.1+ (or run from NetBeans with configured Tomcat)

Login for Demo

Seeded accounts from sample_data.sql:

  • Admin: user_id = 1, password admin123
  • Custodian: user_id = 2, password cust123

App Pages

  • /login - login page
  • /admin - action menu with CRUD forms:
    • Add Student
    • Add Booking
    • Update Booking Status
    • Delete Payment
  • /records - current database records (students, bookings, payments)

Validation Included

  • Rejects future dates
  • Rejects numeric characters in names
  • Validates phone format
  • Validates booking status and academic year format
  • Validates positive numeric IDs

About

Simple web-app to implement hostel database

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages