A console-based Employee Management System built using Java, JDBC, and MySQL, with backup capabilities using text files. This project provides basic employee CRUD operations and can serve as a strong foundation for beginners learning Java database programming.
✅ Add new employees
✅ View all employee records
✅ Update employee details
✅ Delete employee records
✅ Search employees by ID
✅ Store data in MySQL & backup in text files
✅ Clean, modular OOP-based code
Layer | Technology |
---|---|
Language | Java |
Database | MySQL |
DB Connector | JDBC (MySQL Connector/J) |
File Storage | .txt text files |
Interface | Console-based UI |
- Java JDK 8 or above
- MySQL Server
- Any Java IDE (e.g., IntelliJ, Eclipse) or CLI
- MySQL Connector/J
.jar
file
git clone https://github.com/Anshul-ydv/Employee-Management-System.git
cd Employee-Management-System
CREATE DATABASE employee_db;
USE employee_db;
CREATE TABLE employee (
id INT PRIMARY KEY,
name VARCHAR(100),
age INT,
department VARCHAR(100),
salary DOUBLE
);
Open DBConnection.java
and modify:
String url = "jdbc:mysql://localhost:3306/employee_db";
String user = "your_username";
String password = "your_password";
Using IDE:
- Open the project and run
Main.java
Using CLI:
javac -cp .:lib/mysql-connector-java-8.x.x.jar src/*.java
java -cp .:lib/mysql-connector-java-8.x.x.jar src.Main
⚠️ Make sure the MySQL server is running!
Employee-Management-System/
├── src/
│ ├── Main.java
│ ├── Employee.java
│ ├── DBConnection.java
│ ├── EmployeeDAO.java
│ ├── FileHandler.java
│ └── ...
├── resources/
│ └── employees.txt
├── lib/
│ └── mysql-connector-java-8.x.x.jar
├── README.md
└── ...
Contributions are what make the open-source community amazing! If you'd like to improve this project:
- 🍴 Fork the repo
- 🛠 Create your feature branch (
git checkout -b feature/FeatureName
) - ✅ Commit your changes (
git commit -m 'Add new feature'
) - 🚀 Push to the branch (
git push origin feature/FeatureName
) - 📝 Open a Pull Request
Anshul Yadav GitHub: @Anshul-ydv
This project is licensed under the MIT License.
This project stores data in both MySQL and local files – like a dual-core storage engine! 😄