Employee Management System using Java and MySQL
- Frontend: Java Swing ๐ฅ๏ธ
- Backend: MySQL ๐๏ธ
- Connectivity: JDBC ๐
- IDE: IntelliJ IDEA ๐ป
The Employee Management System is a database-driven application designed to efficiently manage employee records within an organization. It enables users to perform essential operations such as adding, updating, deleting, and viewing employee details.
This project demonstrates key Database Management System (DBMS) concepts including:
- Normalization
- Relationships
- Triggers
- Stored Procedures
- Cursors
The system uses Java Swing for the graphical interface and MySQL as the backend database. Advanced SQL features enhance automation and efficiency:
- ๐ Triggers automatically log deleted records
- โ๏ธ Stored procedures handle multi-table insertion
- ๐ Cursors perform bulk salary updates
โ Outcome: A reliable system that reduces redundancy, ensures data integrity, and reflects real-world database applications.
Manual management of employee data is inefficient and prone to errors. Organizations need automated systems for better accuracy and speed.
- Reduce manual work โณ
- Avoid data redundancy ๐
- Maintain data integrity ๐
- Provide fast data access โก
- HR Management Systems ๐ข
- Employee Tracking Systems ๐
- Payroll Systems ๐ฐ
- Add, update, delete employees
- View employee records
- Maintain structured database
- Implement advanced DBMS concepts
- Add employee record
- Update employee details
- Delete employee record
- View/Search employee data
- Fast data retrieval using optimized SQL queries
- Login authentication system ๐
- Use of Prepared Statements (prevents SQL Injection)
- Simple and user-friendly GUI ๐ฏ
Hardware:
- Minimum 4GB RAM
- Intel i3 or higher
Software:
- OS: Windows 10/11
- Frontend: Java Swing
- Backend: MySQL
- Tools: IntelliJ IDEA, MySQL Workbench
๐ (Insert ER Diagram here)
- Employee(emp_id, name, fname, dob, phone, email, address)
- Job(job_id, emp_id, designation, salary)
- Education(edu_id, emp_id, education)
- Login(username, password)
- Employee_Log(log_id, emp_id, action, timestamp)
1NF (First Normal Form)
- All attributes are atomic
- No repeating groups
2NF (Second Normal Form)
- Removed partial dependency
- Salary moved to Job table
3NF (Third Normal Form)
- Removed transitive dependency
- Education stored separately
โ Result: Reduced redundancy + Improved data integrity
Automatically logs deleted employees:
CREATE TRIGGER after_employee_delete
AFTER DELETE ON employee
FOR EACH ROW
INSERT INTO employee_log(emp_id, action)
VALUES (OLD.emp_id, 'DELETED');CALL add_employee(...);๐ Inserts data into multiple tables efficiently
CALL increase_salary();๐ Updates salaries row-by-row
- Entry point of the system
- Validates user credentials via database
- Displays error for invalid login
๐ Purpose: Authentication & Security
- Input fields: name, DOB, phone, email, salary, etc.
- Uses stored procedure for insertion
- Auto-generates Employee ID
๐ Purpose:
- Add new employee
- Maintain normalized structure
- Displays records in tabular format
- Uses SQL JOIN to combine multiple tables
๐ Purpose:
- Easy visualization
- Complete employee details
- Modify existing employee data
- Uses SQL UPDATE queries
๐ Purpose: Maintain accurate records
- Deletes employee using emp_id
- Trigger logs deletion automatically
๐ Purpose:
- Data removal
- Maintain transparency
Connection connection = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/db1", "root", "password");- Uses Stored Procedure
- Inserts into multiple tables
- Uses JOIN queries
- Displays complete data
- Uses PreparedStatement
- Prevents SQL Injection
- Uses DELETE query
- Trigger logs deletion
- Logs deleted records automatically
- Bulk salary update
| Test Case | Input | Expected Output | Status |
|---|---|---|---|
| Add Employee | Valid Data | Record Inserted | โ Pass |
| Delete Employee | emp_id | Record Deleted + Log Created | โ Pass |
| Increase Salary | Procedure | Salary Updated | โ Pass |
The Employee Management System successfully demonstrates both basic and advanced DBMS concepts. The use of normalization ensures minimal redundancy and high data integrity.
Integration of Java (JDBC) with MySQL provides real-world application experience. Advanced features like triggers, stored procedures, and cursors enhance system performance and automation.
- ๐ Develop web-based interface
- ๐ Implement role-based authentication
- ๐ฐ Add payroll system
- โ๏ธ Use cloud database
โจ Overall: This project is a complete, practical implementation of DBMS concepts with real-world relevance and strong technical foundation.