You are on page 1of 7

JDBC

JDBC stands for Java Database Connectivity.


It is a API which enables the java programs to access the database by
execting the !"# statements.
JDBC Architectre$
A JDBC driver is a software component enabling a Java application to
interact with a database
%here are & Drivers
1. %ype ' Driver ( JDBC()DBC bridge
2. Type 2 Driver - Native-API Driver
3. Type 3 Driver - Network-Protocol Driver(Middleare Driver!
". Type " Driver - Data#a$e-Protocol Driver(P%re Java Driver!
Type 1 Driver & (JDBC-'DBC #rid(e!)
%he JDBC type ' driver* also +nown as
the JDBC()DBC bridge.
It ses 'DBC driver to connect to the
database. %he driver converts JDBC
method calls into )DBC fnction calls.
Adva*ta(e$)
Almost any database for which )DBC
driver is installed* can be accessed.
Di$adva*ta(e$)
%he performance is degraded since the
JDBC call goes throgh the bridge to
the )DBC driver
%he )DBC driver and native
connectivity interface mst already be
installed on the client machine.
,ot good for the web
Type 2 Driver & (Native-API Driver!)
%he JDBC type - driver* also +nown as
the ,ative(API driver
It ses the client(side libraries of the
database. %he driver converts JDBC
method calls into native calls of the
database API.
Adva*ta(e$)
As there is no implementation of jdbc(
odbcbridge* its considerably faster than
a type ' driver.
Di$adva*ta(e$)
%he vendor client library needs to be
installed on the client machine.
,ot all databases have a client side
library
%his driver is platform dependent
%his driver spports all java
applications except Applets
Type 3 Driver - Network-Protocol Driver(Middleare Driver!)
%he JDBC type . driver* also +nown as
the Pre Java Driver for Database
/iddleware*
It ses a+iddle tier between the calling
program and the database. %he middle(
tier 0applicatio* $erver1 converts
JDBC calls directly or indirectly into
the vendor(specific data#a$e protocol.
Adva*ta(e$)
%here is no need for the database
vendor library on the client
2ery flexible(It allows access to
mltiple databases sing one driver
Di$adva*ta(e$)
It re3ire database(specific coding to be
done in the middle tier
%he middleware layer added may reslt
in additional latency* bt is typically
overcome by sing better middleware
services.
%he JDBC type & driver* also +nown as
the Direct to Database Pre Java Driver
It converts JDBC calls directly into a
vendor(specific data#a$e protocol.
Adva*ta(e$
Completely implemented in Java to
achieve platform independence.
%hese drivers don4t translate the re3ests
into an intermediary format 0sch as
)DBC1.
%he client application connects directly
to the database server so it improves
performance.
Debgging is easy.
Di$adva*ta(e$
,eed to download a new driver for each
database engine
5g$oracle*m!"#
Type " Driver & (Data#a$e-Protocol Driver(P%re Java Driver!!)

You might also like