4 Types of JDBC Drivers

Source: Internet
Author: User
Tags db2 informix odbc sybase

1. JDBC Framework

JDBC (Java Database Connectivity) is a Java and Database interface specification, composed of classes and interfaces written in the Java language, roughly divided into two categories: for Java

The programmer's JDBC API and the low-level JDBC driver API for database developers. The JDBC driver consists of classes that implement these interfaces. As follows

The overall structure of JDBC has four components: applications, driver managers, drivers, and data sources.

2. Driver type

The JDBC drive is divided into 4 types depending on how it is implemented

1. Jdbc-odbc Bridge plus ODBC driver:jdbc-odbc driver, converts a JDBC call into an ODBC call. (This combination provides JDBC access via ODBC drivers.) ODBC binary Code--and In many cases, database client code--must is loaded on all client machine that uses a JDBC-ODBC Br Idge. Sun provides a JDBC-ODBC bridge driver, which are appropriate for experimental with and for situations in which no other DRI Ver is available.) Note that ODBC binaries (in many cases also including database client code) must be loaded on each client computer that uses the driver. This type of driver is best suited to the Enterprise network (the installation of the client on this network is not the main problem), or the three-tier architecture of the Java Application Service 5, the service code.

2. Native-api Partly-java driver: Converts a JDBC call into a call to the database client API. (A Native-api partly Java technology-enabled driver:this type of driver converts JDBC calls into calls on the client API For Oracle, Sybase, Informix, DB2, or other DBMS. This is the "bridge driver", this style of driver requires that some binary code is loaded on each client machine.) This type of driver converts JDBC calls on the client API to calls from Oracle, Sybase, Informix, DB2, or other DBMS. Note that, like the bridge driver, this type of driver requires that some binaries be loaded onto each client.


3. Pure Java Driver for database middleware: first convert JDBC call to dbms-independent network protocol, then convert server-side middleware to network protocol that specific database server can receive. (Net-protocol fully Java technology-enabled driver #This style of driver translates JDBC calls into the middleware vendor ' s protocol, which is then translated to a DBMS protocol by a middleware server. The middleware provides connectivity to many different databases.) This kind of network server middleware can connect its pure Java client to many different databases. The specific protocol used depends on the provider. Typically, this is the most flexible JDBC driver. It is possible that all providers of this solution offer products that are appropriate for intranet use. In order for these products to also support Internet access, they must handle additional requirements for the security provided by the Web, access through firewalls, and so on. Several providers are adding JDBC drivers to their existing database middleware offerings.

4. Direct-to-database Pure Java Driver: Converts a JDBC call directly into a network protocol that a specific database server can receive. (Native-protocol fully Java technology-enabled driver #This style of driver converts JDBC calls into the network protocol Used directly by DBMSs, allowing a direct call from the client machine to the DBMS server and providing a practical soluti On for intranet access.) This will allow direct invocation of the DBMS server from the client machine, which is a useful solution for intranet access. Since many of these protocols are private, the database provider will be the main source themselves, and several providers are already working on it.


Class 3rd and 4 drivers will be the preferred method of accessing the database from JDBC. The 1th, 2-class driver will be used as a transition scheme before the direct pure Java driver is listed. There may be variants for class 1th and 2 drivers (not listed in the table below), which require connectors, but these are generally more undesirable solutions. The 3rd, 4-Class drivers provide all the benefits of Java, including automatic installation (for example, by using the JDBC applet to download the driver).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.