JDBC drivers are the very important part of the language as this is the part that is responsible for implementing the defined interfaces in the JDBC API and that is because for interacting with the user’s database server. The Java.sql package that is responsible for shipping with the JDK consist of various classes along with their behaviors that are defined and their actual implementations are performed in the third-party drivers. Third party vendors generally implement the java.sql.Driver interface in their database driver.
The implementations of the JDBC driver varies just as the fact of the wide variety of operating systems and hardware platforms that generally operates in the Java language. Sun, the company that has invented Java has divided the implementation types into majorly four categories that are depicted below:
Let's get to know about them one by one
In this type of driver, a JDBC Bridge is basically used in order to access the ODBC drivers that are installed on each of the client machine. By using the ODBC there is a requirement of configuring on the user's system a Data Source Name (DSN) that generally used to represent the target database.
This driver had its part of the share of the popularity especially when Java was first released. This driver was a useful driver because of the fact that most of the databases only supported ODBC access but as of now this type of driver is generally recommended only for the experimental use or in the case when there is no other alternative available.
In this type of driver, the JDBC API calls are generally converted into native C/C++ API calls that are known to be unique to the database. These are those drivers that are typically made available by the database vendors and are used in the exact same manner as the JDBC-ODBC Bridge. Before using this, one thing should be kept in mind that the vendor-specific driver should be installed on each client machine as it is mandatory.
Please note that if the user changes the Database, then the user have to change the native API because it is specific to a database and they are mostly obsolete now. After using this driver the user will experience a speed increase with a Type 2 driver as if the fact that it eliminates ODBC's overhead.
In this type of driver, there is basically a three-tier approach that is used in order to access databases. The JDBC clients are known to use the standard network sockets in order to communicate with a middleware application server. Then the translation of the socket information occurs and the responsibility is of the middleware application server into the call format that is generally required by the DBMS and is forwarded to the database server.
This type of driver is known to be extremely flexible because of the fact that it requires no code to be installed on the client’s system and a single driver is enough to deliver access to the multiple databases.
In this type of driver, a pure Java-based driver basically communicates directly with the vendor's database by the help of the socket connection. The performance of this very JDBC driver is known to be the highest performance driver that is available for the database and it is usually delivered by the vendor itself.
This kind of driver is extremely flexible as the user doesn’t need to install the special software on the client’s machine or the server. Another benefit is that these drivers can be downloaded dynamically.