Java Database Connectivity
|Java Database Connectivity|
(September 21, 2017)
|License||GNU General Public License / Java Community Process|
Java Database Connectivity ( JDBC , English for Java database connectivity ) is a database interface of the Java platform, which offers a uniform interface to databases from different manufacturers and is specially designed for relational databases .
The tasks of JDBC include establishing and managing database connections, forwarding SQL queries to the database, converting the results into a form that can be used by Java and making them available to the program.
JDBC is part of the Java Standard Edition since JDK 1.1. The JDBC classes are in the Java packages
javax.sql. Since JDBC 3.0, JDBC has been further developed as part of the Java Community Process . JSR 221 is the specification for version JDBC 4.0; currently 4.3 (part of Java SE 9).
Types of JDBC drivers
The JDBC specification distinguishes between different types of JDBC drivers.
Type 1 driver
A JDBC type 1 driver only communicates via a JDBC-ODBC bridge driver. The best-known JDBC-ODBC bridge is the one distributed by Oracle. A type 1 driver is therefore dependent on an installed ODBC driver. The JDBC-ODBC bridge driver converts JDBC into ODBC requests.
A type 1 driver is used if there is an ODBC driver for the database, but no stand-alone JDBC drivers.
With Java 9, support for JDBC Type 1 drivers will be discontinued.
Type 2 driver
A type 2 driver communicates with the database server via a platform-specific program library on the client. This means that an additional program library is required for the type 2 driver for each operating system platform.
Type 3 driver
Using the type 3 driver, the JDBC API commands are translated into generic DBMS commands and transmitted (via a network protocol) to a middleware driver on an application server. Only this application server transforms the commands for the specific database server and forwards them to them. A type 3 driver therefore does not need any platform-specific libraries and does not need to know anything about the database server used.
Type 4 driver
With the type 4 driver, the JDBC API commands are translated directly into DBMS commands of the respective database server and transferred to it (via a network protocol). A middleware driver is not used. This means that a type 4 driver can be faster than a type 3 driver, but it is less flexible.
Type 4 drivers are well suited for intranet solutions that want to use fast network protocols.
- Official JDBC home page (English)
- JDBC Tutorial (English)
- List of available JDBC drivers for Oracle databases
- JSR 221 (English)