A Java-based Hospital Management System developed as a university project for the CSE2320 module.
Designed to digitalise and streamline core hospital operations — patient records, doctor assignments, and administrative workflows — replacing slow, error-prone paper-based systems.
eHospital is a console-driven Java application that models the core operations of a hospital environment. It manages patient registrations, doctor records, and appointment data using a relational MySQL database, demonstrating object-oriented design principles, JDBC connectivity, and multi-entity data management in a real-world domain.
- Patient Management — register, update, and retrieve patient records
- Doctor Management — maintain doctor profiles and specialisations
- Appointment / Assignment System — link patients to doctors and track treatment history
- MySQL Persistence — all data stored and queried via JDBC with
mysql-connector - Modular Java Architecture — clean separation of concerns across packages
- IntelliJ IDEA Project — ready to import and run from the IDE with zero configuration
| Layer | Technology |
|---|---|
| Language | Java (JDK 8+) |
| Database | MySQL |
| DB Connectivity | JDBC (mysql-connector library) |
| IDE | IntelliJ IDEA |
| Build | Manual classpath (IntelliJ module) |
eHospital/
├── src/
│ └── cse2320/ # All Java source files (models, services, main entry)
├── .idea/ # IntelliJ IDEA project configuration
├── eHospital.iml # IntelliJ module file (references mysql-connector)
└── .gitignore
- JDK 8 or later
- MySQL Server (local instance)
- IntelliJ IDEA (Community or Ultimate)
- MySQL Connector/J JAR (download here)
- Clone the repository
git clone https://github.com/ashafio/eHospital.git
cd eHospital-
Open in IntelliJ IDEA
Go to
File → Openand select theeHospitaldirectory. IntelliJ will detect the.imlmodule file automatically. -
Add the MySQL Connector library
Go to
File → Project Structure → Libraries → +and add themysql-connector-java-x.x.x.jar. The module expects a project-level library namedmysql-connector. -
Configure the database
Create a MySQL database and update the JDBC connection string in the source (typically in a
DBConnectionorConfigclass):
String url = "jdbc:mysql://localhost:3306/ehospital";
String user = "your_mysql_user";
String pass = "your_mysql_password";Then run the provided SQL schema (if included) or create tables based on the entity classes.
-
Run the application
Open the
mainclass insrc/cse2320/and run it directly from IntelliJ, or compile and run from the terminal:
javac -cp .:mysql-connector-java.jar src/cse2320/*.java
java -cp .:mysql-connector-java.jar cse2320.MainThe application follows a layered OOP approach:
cse2320/
├── model/ # Entity classes — Patient, Doctor, Appointment
├── dao/ # Data Access Objects — JDBC CRUD operations per entity
├── service/ # Business logic layer
├── ui/ # Console menu and user interaction
└── Main.java # Application entry point
- Models map directly to MySQL tables with appropriate fields and constructors
- DAOs encapsulate all SQL queries and prepared statements, keeping database logic out of business code
- Service layer orchestrates operations (e.g. booking an appointment validates both the patient and doctor exist)
- UI layer drives the console menu loop
Developed for the CSE2320 module as part of a BSc in Computer Science and Engineering. The project demonstrates applied knowledge of object-oriented programming, relational database design, JDBC, and multi-class Java application structure.
Shafi (Abid Rahman Shafi) — GitHub: @ashafio