A Java application that connects to a MySQL database and retrieves employee data using JDBC.
This project demonstrates how to use Java Database Connectivity (JDBC) to connect to a MySQL database, execute a query, and display the results. The app queries an Employees table and prints employee details.
- Java
- JDBC
- MySQL
JDBC-EmployeeApp/
├── src/
│ └── employeeapp/
│ └── JDBCConnect.java
├── .gitignore
├── LICENSE
└── README.md
-
Download the MySQL JDBC driver (Connector/J) from the official site.
-
Compile the Java code:
javac -cp ".;path/to/mysql-connector-java-8.0.xx.jar" src/employeeapp/JDBCConnect.java -
Run the Java program:
java -cp ".;path/to/mysql-connector-java-8.0.xx.jar;src" employeeapp.JDBCConnect
Replace
path/to/mysql-connector-java-8.0.xx.jarwith the actual path to your JDBC driver JAR file.
ID Name Position
--------------------------------------------
1 Alice Smith Engineer
2 Bob Johnson Manager
This project is licensed under the MIT License.