Below are the Components of JDBC -
- JDBC API
- JDBC Driver Manager
- JDBC Test Suite
- JDBC Driver
JDBC API -
The JDBC API provides programmatic access to relational data from the Java Programming Language. Using the JDB AP, an application can execute SQL statements, retrieve results. JDBC API can also interact with multiple data bases in a distributed, heterogeneous environment.
The JDBC API is a part of the Java Platform, which Includes the Java Standard Edition and the Java Enterprise Edition.
The JDBC 4.0 API is divided into tow packages : java.sql and javax.sql. Both packages are included in the Java SE and Java EE platform.
JDBC Driver Manager -
The JDBC Driver Manager class define objects which can connect Java application to a JDBC Driver. In another word, it manages the list of the database driver.
In the below-given diagram, you can see Java Application (Left) Driver Manager (Middle) Database (Right) So from Java Application if you want to connect to MySql/Oracle/SQL Server database then you have to load the database specific driver under Driver Manager.
Loading the Driver can be done using below given code.
Class.forName("com.mysql.jdbc.Driver"); MYSQL Class.forName("com.oracle.jdbc.DriverManager; Oracle