A comprehensive Hospital Management System built with Java, Java Swing, and MySQL. This system implements database design (3NF normalization), CRUD operations, performance optimization, and integration with a modern GUI framework.
Complexity: Advanced
Development Time: 15+ hours
Target: Azure AKS, Azure App Service, Cloud Readiness, Linux, OpenJDK 11, OpenJDK 17, OpenJDK 21
Architecture: MVC with Services/DAO (Model Context Protocol)
- Java Version: Java 11, JDBC
- Frontend: Java Swing 2.1.0
- Database: MySQL 8.0
- Build Tool: Maven 3
- Architecture: MVC with Services/DAO Layers
- Add, view, update, delete patient records
- Search patients by name or ID
- Store medical history and contact information
- Input validation and data integrity checks
- Track doctor specialization and parameters
- View doctor availability
- Search and filter doctors by specialization
- Schedule appointments between patients and doctors
- Track appointment status (Scheduled, Completed, Cancelled)
- View appointment history
- Appointment data and time validation
- Track medical supplies and equipment
- Monitor inventory levels
- Record usage and restocking
- Alert system for low stock times
- Create and manage prescriptions
- Track prescribed medications and dosages
- Link prescriptions to appointments and patients
- Prescription history and validation
- Organize doctors by departments
- Manage department information
- Track department-specific operations
- Collect patient feedback and ratings
- Track patient satisfaction
- Generate feedback reports
- In-memory caching for frequently accessed data
- Query optimization with database indexing
- Performance metrics tracking
- Before/after optimization comparison reports
- System statistics and overview
- Query performance metrics
- Data visualization and summaries
The database uses Entity-Relationships and 3NF normalization:
- Patients: Patient demographics and contact information
- Doctors: Doctor profiles and specializations
- Appointments: Patient-doctor appointment records
- Prescriptions: Prescription records
- Prescription Items: Individual medications and dosages
- Patient Feedback: Patient satisfaction feedback
- Medical Inventory: Medical supplies and equipment
- Departments: Hospital departments
- Patients (1:M) Appointments
- Doctors (1:M) Appointments
- Patients (1:M) Prescriptions
- Prescriptions (1:M) Prescription Items
- Patients (1:M) Patient Feedback
- Medical Inventory (1:M) Equipment
All tables normalized to 3NF:
- Elimination of redundant data
- Removal of transitive dependencies
- Composite indexes for frequently filtered columns
- Java 11 or higher
- Maven 3.6+
- MySQL 8.0+
- Git
git clone https://github.com/REGENCY-14/HospitalManagementSystem2.git
cd HospitalManagementSystem2mysql -u root -p
SOURCE database/hospital_schema.sqlmvn clean installOption 1: Windows
./run.batOption 2: Linux/macOS
./run.shOption 3: Direct Execution
mvn clean exec:java -Dexec.mainClass="org.example.Main"- Indexed columns on high-frequency lookup columns (patient ID, doctor ID, date)
- Cached execution plans with EXPLAIN & ANALYZE
- Connection pooling for JDBC
- HashMap caching for patient/doctor lookups
- Lazy loading for related entities
- Query optimization with filtered columns
- Binary search on sorted patient/doctor lists
- Case-insensitive substring matching for name searches
- Indexed database queries for fast lookups
- Query execution time tracking
- Cache hit/miss statistics
- Performance comparison reports
Error: "Failed to establish database connection"
Solution:
- Verify MySQL is running
- Check credentials in DBConnection.java
- Confirm database exists: SHOW DATABASES;
- Verify schema is loaded: USE hospital; SHOW TABLES;
Error: "Java version not compatible" or "Maven not found"
Solution:
- Verify Java version:
java -version(should be 11 or higher) - Install Maven:
mvn --version(should be 3.6+) - Check JAVA_HOME environment variable
Error: "Cannot find symbol" or "Package not found"
Solution:
- Ensure all dependencies installed:
mvn clean install - Check internet connection for dependency download
- Verify pom.xml configuration
This project is provided for educational purposes. Feel free to use, modify, and distribute for learning.
Project: Hospital Management System
GitHub: https://github.com/REGENCY-14/HospitalManagementSystem2
Created: January 2026
- Advanced search with filters and pagination
- REST API implementation for patient/medical/logs
- Mobile app integration
- Machine learning for appointment predictions
- SMS/Email notifications for reminders
- Reporting and analytics suite
- Collaborative data models
- Specialized queries for research
- Real-time monitoring and alerts
✓ Active Development ✓ Last Updated: January 14, 2026