JDBC
JAVA DATA BASE CONNECTIVITY
The jdbc api provides developers with a way to connect to relational data from with in java code.using the jdbc api,developer can create a client that can connect to a database , execute structure query languages) statements, and process the result of those statements.
JDBC API had two java packages: java.sql , and javax.sql.
Java.sql : this package contains classes and interfaces function such as creating function, execute statements and prepared statements and running batch queries and advanced function such as batch update, scrollable result set.
Javax.sql: this package introduce some major architectural change to jdbc programming compared to java.sql,and provide better abstraction for connection management, distributed transactions , connection polling etc.
DATA BASE DRIVERS
A jdbc driver is a middleware layer that translates the jdbc calls to the vendor-specific API. There are four different approach to connect an application to a data base driver. the following classification is an industry standard.
Type 1 Driver(jdbc-odbc Bridge): the first category of JDBC drivers provides abridge between the jdbc api and odbc api.the bridge translates the standard jdbc calls to corresponding odbc calls, and send them to the odbc data source via libraries.
Type 2 driver
Type 2 driver part java, part native driver): type 2 drivers use a mixture of java implementation and vendor-specific native api to provide data access. And so in general a type2 driver is faster then type 1 driver.
Jdbc database calls are translated into vender-specific api calls. the database will process the request and send the result back through the api,which will in turn forward them back to the jdbc driver. the jdbc driver will translate the results to the jdbc standard and return them to the java application.
Type 3 driver
Type 3 driver Intermediate Database Access Server): type3 drivers use an intermediate(middleware)database server that has the ability to connect multiple java clients to multiple database servers.
The protocol used to communicate between clients and the intermediate server depends on the middleware server vendor but the intermediate server can use different native protocols to connect to different database.

BEA Web logic include a type 3 driver.
One of the benefits of type 3 driver is that it allows flexibility on the architecture of the application.
Type 4 driver
Type 4 driver Pure java driver): type 4 driver are a pure java driver, and other name is thin driver.
Type 4 driver convert the jdbc api calls to direct network calls using vendor-specific networking protocols. they do this by direct socket connections with the database. Type4 driver generally offer better performance then type1,type2,tpe3 drivers
Type 4 drivers are also the simplest drivers since there are no additional libraries or middleware to install.
Gotopage