0% found this document useful (0 votes)
36 views

Advjava 2

JDBC drivers convert SQL statements into a format that databases can understand and retrieve results from SQL statements as JDBC API objects. There are four types of JDBC drivers: JDBC-ODBC bridge drivers use ODBC to connect, native-API drivers communicate directly with databases' native APIs, network protocol drivers use middleware between the Java client and database, and native protocol drivers convert JDBC calls directly to database protocols without intermediaries.

Uploaded by

Amit Pandey
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Advjava 2

JDBC drivers convert SQL statements into a format that databases can understand and retrieve results from SQL statements as JDBC API objects. There are four types of JDBC drivers: JDBC-ODBC bridge drivers use ODBC to connect, native-API drivers communicate directly with databases' native APIs, network protocol drivers use middleware between the Java client and database, and native protocol drivers convert JDBC calls directly to database protocols without intermediaries.

Uploaded by

Amit Pandey
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 13

JDBC Drivers

JDBC Drivers:
Convert SQL statements into a form that a particular database can interpret.

Retrieve the result of SQL statements and convert the result into equivalent
JDBC API class objects. Are of four types:
JDBC-ODBC Bridge driver

Native-API Partly-Java driver


JDBC-Net Pure-Java driver Native Protocol Pure-Java driver

Confidential

Type1 Driver JDBC-ODBC bridge


The calling java application hands over the required query to JDBCAPI in format of java String which is converted to JDBC-Statement

by JDBC-API.
Further this Statement is handed over to the JDBC-ODBC Bridge driver which converts it to ODBC (Open Database Connectivity)

Query that is feed to ODBC (A Microsoft tool to connect with any


database)

Confidential

Type1 Driver JDBC-ODBC bridge

Confidential

Type1 Driver JDBC-ODBC bridge


Advantages: Simple to use for all kind of Database

Disadvantages: Poor performance Overhead of converting JDBC query to ODBC query where as required

is SQL command
Depended on ODBC

Confidential

Type2 Native API Driver


The JDBC type 2 driver, also known as the Native-API driver .It uses the local native libraries provided by the database venders to

access databases.
Type 3 Driver maps the JDBC call to the native method calls, which are passed to the local native Call Level Interface (CLI).

The type 2 driver provides more functionality and better performance


than the type 1 driver as it does not have the overhead of the additional ODBC function calls.

Confidential

Type2 Native API Driver

Confidential

Type2 Native API Driver


Disadvantages: The vendor client library needs to be installed on the client machine

Cannot be used in web-based application due the client side software


needed. Not all databases have a client side library

Advantages: Better performance than Type 1 since no JDBC to ODBC translation is needed.

Confidential

Type 3 Driver - Network-Protocol Driver

Confidential

Type 3 Driver - Network-Protocol Driver


The JDBC type 3 driver, also known as the JDBC-Net Pure Java Driver is consists of client and server portion. Server portion is know

as middleware.
Java Application send the JDBC call to Client portion which convert JDBC calls to Database calls.

Database call are sent to the middleware.


Middleware forward the request to the database.

Confidential

Type 3 Driver - Network-Protocol Driver


Advantages: Since the communication between client and the middleware server is

database independent, there is no need for the vendor db library on the


client machine.

Disadvantages: Requires database-specific coding to be done in the middle tier. An extra layer added may result in a time-bottleneck.

Confidential

Type 4 Driver - Native-Protocol Driver


The JDBC type 4 driver, also known as the Direct to Database Pure Java Driver is a database driver implementation that converts

JDBC calls directly into the vendor-specific database protocol.


The type 4 driver is written completely in Java and is hence platform independent

Confidential

Type 4 Driver - Native-Protocol Driver

Confidential

Type 4 Driver - Native-Protocol Driver


Advantages: These drivers don't translate the requests into an intermediary format

(such as ODBC), nor do they need a middleware layer to service


requests. Thus the performance may be considerably improved. All aspects of the application to database connection can be managed within the JVM; this can facilitate easier debugging.

Disadvantages: At client side, a separate driver is needed for each database.

Confidential

You might also like