This is a Console-Based Employee Management System built with Java and MySQL.
It allows you to:
- Insert new employees
- Search employees (by Name, SSN, or ID)
- Update employee data
- Update salaries within a range
- View pay history
- Generate reports (pay by division, pay by job title)
✅ MySQL database connection (JDBC)
✅ Console-based User Interface
✅ No GUI needed (JavaFX not required)
Main.java— Console UI entry pointEmployee.java— Abstract class for employeeFullTimeEmployee.java— Employee subclassPayStatement.java— Salary history per employeeEmployeeManager.java— Manages database operationsReportService.java— Reporting functionsDBConnection.java— Handles MySQL connectioncreate_employeeDB.sql— SQL file to create database/tablecompile_and_run.bat— Windows batch file to compile and run automatically
- Java JDK installed (version 8 or higher)
- MySQL server installed and running
- MySQL Connector/J
.jarfile downloaded
📥 Download MySQL Connector/J from MySQL Official Site.
Extract the ZIP, find the.jarfile (example:mysql-connector-java-8.0.33.jar).
Place the .jar somewhere you can easily access (e.g., Desktop or Downloads folder).
- Open MySQL Workbench or Command Line
- Run the provided SQL script:
SOURCE create_employeeDB.sql;It will:
- Create database
employeeDB - Create table
employeeData
Open compile_and_run.bat in a text editor and update the path to your MySQL Connector .jar file.
Example:
SET JAR_PATH=C:\Users\yourname\Downloads\mysql-connector-java-8.0.33.jar
Save the file.
Now simply double-click compile_and_run.bat, or run it from Command Prompt:
./compile_and_run.batThis will:
- Compile all
.javafiles with the.jarincluded - Launch the console application automatically
If you prefer doing it manually from command line:
javac -cp ".;path/to/mysql-connector-java-8.0.33.jar" *.java
java -cp ".;path/to/mysql-connector-java-8.0.33.jar" Mainjavac -cp ".:path/to/mysql-connector-java-8.0.33.jar" *.java
java -cp ".:path/to/mysql-connector-java-8.0.33.jar" MainReplace path/to/ with your actual .jar location.
| Feature | Description |
|---|---|
| Add Employee | Add full-time employee |
| Search Employee | By Name, SSN, or Employee ID |
| Update Employee | Update fields like name, phone, email, etc. |
| Update Salary | Increase salary by a % within a salary range |
| View Pay History | Show employee's salary records |
| Reports | Total pay by division, total pay by job title |
For educational use only.