How sriharsha1405/hotel-reservation-system works
Project Type and Purpose
• This is a Java-based console application (monolithic) that provides CRUD operations for hotel reservations.
• It uses JDBC (MySQL Connector/J) to persist data in a MySQL database.
• The schemas/ folder holds your SQL DDL, and src/HotelReservationSystem.java contains UI, business logic, and data-access code all in one class.
File Structure
• Top-level:
• .gitignore, IDE configs (.idea/, *.iml)
• README.md (project description)
• schemas/ (SQL scripts for table creation)
• src/ (Java source)
• No separate frontend/backend directories—this is a single executable class.
• Database connection constants and menu-driven UI live in HotelReservationSystem.java.
README for Insights
• Prerequisites: JDK, MySQL, JDBC driver.
• Setup steps configure DB credentials in code and then compile/run.
• Features: add/view/edit/delete reservations via console.
Main Components & Their Relationships
a. Components:
1. Console UI Layer
• Presents menu, reads user input, displays results.
2. Business Logic Layer
• Orchestrates create/read/update/delete operations.
3. Data Access Layer (DAL)
• JDBC interactions: opens connections, prepares statements, executes queries.
4. MySQL Database
• reservations table (and any supporting tables) defined by schemas/ SQL scripts.
b. Interactions:
• UI → calls Business Logic methods
• Business Logic → invokes DAL methods
• DAL → uses JDBC → MySQL
• MySQL returns results → DAL → Business Logic → UI
c. Architectural Patterns:
• Monolithic, layered approach (even though all code is in one class, conceptually three layers).
• Menu-driven control flow
• Direct JDBC (no ORM)
d. Key Technologies:
• Java (JDK 8+)
• MySQL
• MySQL Connector/J (JDBC driver)
Putting It All Together
• Java class: HotelReservationSystem.java
• SQL scripts: schemas/*.sql
• Technologies: JDK, MySQL Connector/J