Types of JDBC Drivers and its Connectivity with Database
Published in
2 min readFeb 15, 2020
The JDBC is normally use for the java connectivity. It is an application programming interface for the java language.
The API interface is made of 4 main interface.
- java.sql.DriverManager → The Driver Manager can be used to establish a connection, and connecting through the Data Source.
- java.sql.Connection → An application can alter the behavior of connection by invoking the method associated with the object.
- java.sql statement → An application uses the connection object to create the statement. And the object is executing SQL queries.
- java.sql.resultset → The resultset is returned when the SQL query is executed by a statement object.
There are four types of JDBC Drivers
- JDBC-ODBC Bridge → It is a JDBC-ODBC bridge drivers. ODBC is widely used by the developers to connect databases in a non java environment. The bridge drivers is useful for the small companies but the opposite of large companies disadvantage it is not suitable for the large-scale application.
- Native-API partly java technology-enabled driver → It is mainly use native API for data access and provide java wrapper classes to be able to be invoked using JDBC drivers. It has better performance than that of type 1, in the native API drivers because contains compiled coded.
- A net-protocol fully java technology-enabled driver → This is fully written 100% java code. The extra adds complexity the data access efficiency, which translates JDBC API call into a DBMS independent net protocols. This is better performance of types 1 and types 2.It can use when company has multiple database and want to single JDBC driver to connect to all of them.
- A native-protocol fully java technology-enabled driver → It is the direct to the database pure java driver. It convert JDBC technology calls into the network protocol used by different DBMS directly. The basically convert JDBC into packets of the specific database.