Java Database Connectivity (JDBC) API

The Java Database Connectivity (JDBC) API provides a set of common, vendor-neutral classes and interfaces to enable database access to different databases from Java applications. The JDBC API specification defines a standard set of interfaces that vendors of JDBC drivers need to implement to conform to the JDBC API. Application component providers can use the JDBC driver in their application components to access data from databases. The JDBC drivers fall in one of the following four categories:

  • Type 1 driver The type 1 driver is the JDBC-ODBC bridge. The JDBC-ODBC bridge communicates with an ODBC driver using the Java Native Interface (JNI) and acts as a translator between the Java application/JDBC API and the ODBC driver. The ODBC driver is the one that actually interacts with the database to perform the database-specific operations.

  • Type 2 driver The type 2 JDBC driver is actually a set of wrapper Java classes that use the JNI to interact with the underlying database-driver software. The type 2 driver leverages the existing vendor-provider database-driver software and hence is platform dependent.

  • Type 3 driver The type 3 driver consists of a set of Java wrapper classes. The driver interacts with a server-side application installed on a middleware server, with which it establishes a connection over the network using a socket connection. The middleware server acts as a proxy for the JDBC driver and performs database interaction on its behalf.

  • Type 4 driver The type 4 driver is a pure Java implementation of a JDBC driver. The entire functionality of interacting with the database (the database driver protocol) is implemented as a set of Java classes, thus making it more portable.

The JDBC API was one of the first APIs introduced in Java and was part of the Java 2 Standard Edition before its role in enterprise development was recognized and the JDBC API was included as a part of the J2EE specification. Database vendors often provide implementations of JDBC drivers for their databases that comply with the JDBC API specification. This enables application component providers that use the JDBC API in their application components to access any database as long as a JDBC driver is available for the database.



Sams Teach Yourself BEA WebLogic Server 7. 0 in 21 Days
Sams Teach Yourself BEA WebLogic Server 7.0 in 21 Days
ISBN: 0672324334
EAN: 2147483647
Year: 2002
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net