Database Reference
In-Depth Information
Java
Source
Code
Class
Files
(others)
Java
Compiler
Mac
UNIX
Windows
Java
Virtual
Machine
Class
File
Figure 19-8
Java programming environment.
JDBC JDBC (Java Database Connectivity) bases its structure on ODBC (Open
Database Connectivity), commonly used to provide interfaces between application
programs and any type of ODBC-compliant database systems. JDBC is the most
effective approach for Java programs to access relational database systems. JDBC
allows you to write Java programs that would work with any database system that
has a JDBC driver. The driver provides a uniform interface to a Java program irre-
spective of the type of database system. Most database vendors offer JDBC drivers
for use with their products.
The JDBC method involves two components for the APIā€”one on the side of the
program and the other on the side of the database server. A Java program can use
the JDBC API to establish a connection to the database server through a pure Java
JDBC driver at the database server side.
Here are the common options for the connectivity:
Driver with Direct Connection In this method, the pure Java JDBC driver estab-
lishes a direct connection with the database server. JDBC calls are converted into
the network protocol used by the DBMS, enabling a direct call from the client
machine to the database server. This seems to be a practical approach for database
access on the organization's intranet.
Driver Connecting Through Middleware In this method, JDBC calls are converted
into the protocol of the middleware vendor and subsequently translated into the
DBMS protocol by the middleware server. Because the middleware provides con-
nectivity to a number of database systems, this method has flexibility.
The JDBC-ODBC Bridge This method provides JDBC access through ODBC
drivers. ODBC code is required to be loaded on a client machine that adopts this
Search WWH ::




Custom Search