This project demonstrates how Java connects to a database using JDBC (Java Database Connectivity).
It covers the basics of establishing a connection, executing queries, and performing CRUD operations.
- Connect Java application to a database
- Execute SQL queries (INSERT, SELECT, UPDATE, DELETE)
- Handle exceptions and close connections safely
- Simple and easy-to-understand code for beginners
- Java (JDK 17 or higher)
- JDBC
- MySQL / PostgreSQL (any relational database)
- SQL
- Clone this repository
- Set up your database and update DB credentials in the code
- Compile and run the project:
javac Main.java java Main