A complete Java desktop application for managing employee records with MySQL database. Built with Java Swing GUI and demonstrates core OOP concepts.
This Employee Management System is a college-level project that provides a complete CRUD (Create, Read, Update, Delete) application for managing employee data. It features a dark-themed modern UI and secure admin authentication.
Key Highlights:
- 🔐 Secure admin login system
- 👥 Complete employee management (Add, View, Search, Update, Delete)
- 🎨 Modern dark-themed UI
- 💾 MySQL database integration
- 📊 Sample data included
| Feature | Description |
|---|---|
| Admin Login | Secure authentication with username/password |
| Add Employee | Create new employee records with full details |
| View Employees | Display all employees in a styled table format |
| Search Employee | Quick search by Employee ID or Name |
| Update Employee | Modify existing employee information |
| Delete Employee | Remove employee records with confirmation |
| Dashboard | Menu-driven interface with employee statistics |
- Language: Core Java (JDK 8+)
- GUI Framework: Java Swing (Dark Theme)
- Database: MySQL 8.0
- Connectivity: JDBC (MySQL Connector/J)
- Architecture: DAO Pattern (Data Access Object)
emp-management/
├── src/
│ ├── Main.java # Application entry point
│ ├── model/
│ │ └── Employee.java # Employee entity (POJO)
│ ├── dao/
│ │ ├── DBConnection.java # Database connection (config-based)
│ │ ├── EmployeeDAO.java # Employee CRUD operations
│ │ └── AdminDAO.java # Admin authentication
│ └── gui/
│ ├── AdminLogin.java # Login screen with dark theme
│ ├── AdminDashboard.java # Main dashboard menu
│ ├── AddEmployee.java # Add employee form
│ ├── ViewEmployees.java # Employee list view
│ ├── UpdateEmployee.java # Update employee form
│ └── SearchEmployee.java # Search functionality
├── database/
│ └── schema.sql # MySQL database schema
├── docs/
│ └── documentation.md # Detailed documentation
├── config.properties.template # Configuration template
├── setup_database.bat # Database setup script
├── run_project.bat # Quick run script
└── README.md # This file
Before running this project, ensure you have:
- Java JDK 8 or higher installed
- MySQL Server 5.7 or higher installed
- MySQL JDBC Driver (Connector/J)
Download and install MySQL Server from [https://dev.mysql.com/downloads/installer/]
Remember your MySQL root password during installation.
-
Copy the configuration template:
copy config.properties.template config.properties
-
Edit
config.propertieswith your MySQL credentials:db.url=jdbc:mysql://localhost:3306/emp_management db.user=root db.password=YOUR_MYSQL_PASSWORD
⚠️ Important: Never commitconfig.propertiesto GitHub (it's already in.gitignore)
Run the database setup script:
setup_database.batOr manually run the SQL file:
mysql -u root -p < database/schema.sql- Download MySQL Connector/J from: https://dev.mysql.com/downloads/connector/j/
- Extract to
lib/mysql-connector-j-8.0.33.jar
run_project.bat# Compile
javac -d classes -cp "lib/mysql-connector-j-8.0.33.jar" src/model/*.java src/dao/*.java src/gui/*.java src/Main.java
# Run
java -cp "classes;lib/mysql-connector-j-8.0.33.jar" Main- Username:
admin - Password:
admin123
- Login: Enter admin credentials on the login screen
- Dashboard: View employee statistics and select operations:
- Add Employee - Create new employee record
- View Employees - Browse all employees in table
- Search Employee - Find by ID or Name
- Update Employee - Edit employee details (enter ID first)
- Delete Employee - Remove employee (enter ID with confirmation)
- Logout - Return to login screen
CREATE TABLE admin (
username VARCHAR(50) PRIMARY KEY,
password VARCHAR(100) NOT NULL
);CREATE TABLE employee (
emp_id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
department VARCHAR(50) NOT NULL,
position VARCHAR(50) NOT NULL,
salary DECIMAL(10, 2) NOT NULL,
phone VARCHAR(20),
email VARCHAR(100),
joining_date DATE NOT NULL
);The application features a modern dark theme with:
- Dark background (#303030)
- White text for high contrast
- Colored headers matching each form's purpose
- Styled input fields and buttons
- Responsive table views
| Error | Solution |
|---|---|
config.properties not found |
Create file from template and add your password |
MySQL JDBC Driver not found |
Ensure JAR is in lib/ folder and classpath is correct |
Access denied for user |
Check username/password in config.properties |
Unknown database |
Run setup_database.bat to create database |
ClassNotFoundException |
Verify MySQL Connector JAR is present |
- Encapsulation: Private fields with public getters/setters in Employee class
- Abstraction: DAO classes hide database implementation details
- Inheritance: GUI classes extend JFrame and other Swing components
- Polymorphism: Method overloading and interface implementations
- Classes & Objects: Employee entity, DAO objects, GUI forms
- Passwords are stored in
config.properties(excluded from Git via.gitignore) - Never commit actual configuration files to public repositories
- Use strong MySQL root passwords in production
- Consider implementing password hashing for production use
This project is for educational purposes only.
College Student Project - Employee Management System
Need Help? Check the docs/documentation.md file for detailed project documentation including system requirements, working principles, and future enhancements.