Java Database Connectivity

Java Database Connectivity (JDBC, English for Java Database Connectivity ) is a database interface to the Java platform that provides a unified interface to databases from different vendors and is specifically geared towards relational databases.

JDBC is similar to ODBC, for example, on Windows or DBI on Perl in its function as a universal database interface.

The tasks of JDBC to build and manage database connections belongs to forward SQL requests to the database and convert the results into a usable form for Java and make available to the program.

Specific drivers are required for each specific database that implement the JDBC specification. These drivers are usually supplied by the manufacturer of the database system.

JDBC is part of the Java Standard Edition since JDK 1.1. The JDBC classes are in the Java packages java.sql and javax.sql. Since JDBC 3.0 JDBC is further developed under the Java Community Processes. JSR 221 is the specification of the version of JDBC 4.0; currently 4.1 (part of Java SE 7).

Types of JDBC drivers

In the JDBC specification different types of JDBC drivers are distinguished.

Type 1 drivers

A JDBC type 1 driver communicates exclusively via a JDBC - ODBC Bridge driver. The best-known JDBC-ODBC Bridge is the product marketed by Sun. For a type 1 driver is dependent on an installed ODBC drivers. The JDBC - ODBC Bridge driver converts JDBC in order ODBC queries.

A type 1 driver is used when there is an ODBC driver, but not stand-alone JDBC driver to the database.

Type 2 driver

A type 2 driver communicates via a platform-specific program library on the client to the database server. This means that for each operating system platform to the type 2 driver an additional program library is needed.

Type - 3 driver

By means of the type 3 driver are translated into generic DBMS commands and transmitted ( via a network protocol ) to a middleware driver on an application server, the JDBC API commands. Only this application server transforms the commands for the specific database server and forwards it to them further. A Type 3 driver requires that no platform-specific libraries and has nothing on the database server used to know.

Type 3 drivers are very well suited for Internet protocols in conjunction with firewalls.

Type 4 driver

In type 4 driver, the JDBC API commands are translated directly into DBMS commands of the relevant database server and transmitted to them ( via a network protocol ). A middleware driver is not used. Thus, a Type 4 driver faster than a Type 3 driver be, but is less flexible.

Type 4 drivers are well suited for intranet solutions that want to use fast network protocols.

432174
de