Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home4/vir007/public_html/geekmantra.com/contact/connect.php on line 2
Free Online JDBC Tutorials,JDBC Programming Tutorials,JDBC notes
GeekMantra
Search Site

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home4/vir007/public_html/geekmantra.com/contact/connect.php on line 2
J2SE [Java 2 Standard Edition]
Core Java Introduction
Exception Handling
Collection & Util Classes
Multithreading
Input & Output Streams
Applet
Adwance Windows Toolkit (AWT)
Swings (Adwance GUI)
Event Handling
Java Networking
Remote Method Invocation (RMI)
Java Database Connectivity (JDBC)
J2EE [Java 2 Enterprise Edition]
Java 2 Enterprise Edition Intoduction (J2EE)
Server Side Programming (Servlet)
Java Server Pages (JSP)
Enterprise Java Bean
MVC Framework (Struts)
Advance Framework (Springs)
Object-relational mapping (Hibernate)
eXtensible Markup Language (XML)
Asynchronous JavaScript and XML (AJAX)
Miscellneous
Monthly News Letter
Free SCJP Samples
Interviews Questions For Freshers
Interviews Questions For Experinced
Most Visited Links
Most Freaky Links
Advertisements

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home4/vir007/public_html/geekmantra.com/contact/connect.php on line 2

What Is Java Database Connectivity (JDBC)

Java Developers found that they require a frame work that will allow to  build a uniform interface over the database connectivity systems such a framework would allow programmer to write a single  database interface over many Platforms this frame work is known as the java database connectivity interface.

JDBC Architecture

JDBC is closely modeled on the SQL call level interface. JDBC layer comprises of two main layers:- a.)JDBC API b) JDBC Driver API .The JDBC API is the layer with which the java program interfaces It basically defines set of classes for use in  java applet /applications which are independent of the underlying database.The JDBC Driver API on the other hand ,provides link between the database and JDBC API. The JDBC Driver API layer is provided by the database Vendor.

JDBC API is made up of 4 main interfaces
1. java.sql.DriverManager
2. java.sql.Connection
3. java.sql.Statement
4. java.sql.ResultSet
 
In addition to these, the following support interfaces are also available
  java.sql.CallableStatement
  java.sql.PreparedStatement
  java.sql.ResultSetMetadata
  java.sql.DatabaseMetaData

    The JDBC API uses a Driver Manager and database-specific drivers to provide transparent connectivity to heterogeneous databases. The JDBC driver manager ensures that the correct driver is used to access each data source. The Driver Manager is capable of supporting multiple concurrent drivers connected to multiple heterogeneous databases. A JDBC driver translates standard JDBC calls into a network or database protocol or into a database library API call that facilitates communication with the database. This translation layer provides JDBC applications with database independence. If the back-end database changes, only the JDBC driver need be replaced with few code modifications required. There are four distinct types of JDBC drivers

Following Figure Elaborate On The Above Mention Theory

JDBC Architecture

Types Of JDBC Drivers


JDBC Driver

Type I Drivers
Translates JDBC API calls into Microsoft Open Database Connectivity (ODBC) calls that are then passed to the ODBC driver. The ODBC binary code must be loaded on every client computer that uses this type of driver.Bridge solutions generally require software to be installed on client systems, meaning that they are not good solutions for applications that do not allow you to install software on the client.

Type II Drivers
The type 2 drivers are native API drivers. This means that the driver contains Java code that calls native C or C++ methods provided by the individual database vendors that perform the database access. Again, this solution requires software on the client system.

Type III Drivers
JDBC driver on the client uses sockets to call a middleware application on the server that translates the client requests into an API specific to the desired driver. As it turns out, this kind of driver is extremely flexible since it requires no code installed on the client and a single driver can actually provide access to multiple databases.

Type IV Drivers

Using network protocols built into the database engine, type 4 drivers talk directly to the database using Java sockets. This is the most direct pure Java solution. In nearly every case, this type of driver will come only from the database vendor.
The Red Brick JDBC Driver is a pure Java Type-4 driver based on Version 2.0 of the JDBC API.

Related Technologies
ODBC
Requires configuration (odbc.ini)
RDO, ADO
Requires Win32
OODB
e.g. ObjectStore from ODI
JavaBlend
maps objects to tables transparently (more or less)