What is JDBC?
JDBC stands for “Java DataBase Connectivity” It is an API (Application Programming Interface) which consists of a set of Java classes, interfaces and exceptions ….
Why use JDBC?
JDBC is there only to help you (a Java developer) develop data access applications without having to learn and use proprietary APIs provided by different RDBMS vendors. You just have to learn JDBC and then you can be sure that you’ll be able to develop data access applications which can access different RDBMS using different JDBC drivers.
How to Make a DataBase Connection?
1-you need to select the correct JDBC driver for your database.

MySQL JDBC driver:


Postgresql JDBC driver:


Microsoft JDBC Driver for SQL Server:

2-Load the JDBC driver.
3-Start the JDBC connection to your database
This Example show how to do this ?
Note: in this connection I used postgresql driver