ODBC is for Microsoft and JDBC is for Java applications. ODBC can?t be directly used with Java because it uses a C interface. ODBC makes use of pointers which have been removed totally from Java. ODBC mixes simple and advanced features together and has complex options for simple queries. But JDBC is designed to keep things simple while allowing advanced capabilities when required. ODBC requires manual installation of the ODBC driver manager and driver on all client machines. JDBC drivers are written in Java and JDBC code is automatically installable, secure, and portable on all platforms. JDBC API is a natural Java interface and is built on ODBC. JDBC retains some of the basic features of ODBC.
No. The JDBC-ODBC Bridge does not support concurrent access from different threads. The JDBC-ODBC Bridge uses synchronized methods to serialize all of the calls that it makes to ODBC. Multi-threaded Java programs may use the Bridge, but they won't get the advantages of multithreading.
In addition, deadlocks can occur between locks held in the database and the semaphore used by the Bridge. We are thinking about removing the synchronized methods in the future. They were added originally to make things simple for folks writing Java programs that use a single-threaded ODBC driver.
ODBC stands for Open Data Base Connectivity. Using a ODBC Driver you can connect to any database.
Type 1:
A JDBC-ODBC bridge provides JDBC API access via one or more ODBC drivers. Note
that some ODBC native code and in many cases native database client code must
be loaded on each client machine that uses this type of driver. Hence, this
kind of driver is generally most appropriate when automatic installation and
downloading of a Java technology application is not important.
Type 2:
A native-API partly Java technology-enabled driver converts JDBC calls into
calls on the client API for Oracle, Sybase, Informix, DB2, or other DBMS. Note
that, like the bridge driver, this style of driver requires that some binary
code be loaded on each client machine.
Type 3:
A net-protocol fully Java technology-enabled driver translates JDBC API calls
into a DBMS-independent net protocol which is then translated to a DBMS
protocol by a server. This net server middleware is able to connect all of its
Java technology-based clients to many different databases. The specific
protocol used depends on the vendor. In general, this is the most flexible JDBC
API alternative. It is likely that all vendors of this solution will provide
products suitable for Intranet use. In order for these products to also support
Internet access they must handle the additional requirements for security,
access through firewalls, etc., that the Web imposes. Several vendors are
adding JDBC technology-based drivers to their existing database middleware
products.
Type 4:
A native-protocol fully Java technology-enabled driver converts JDBC technology
calls into the network protocol used by DBMSs directly. This allows a direct
call from the client machine to the DBMS server and is a practical solution for
Intranet access. Since many of these protocols are proprietary the database
vendors themselves will be the primary source for this style of driver. Several
database vendors have these in progress.
Type 1:
A JDBC-ODBC bridge provides JDBC API access via one or more ODBC drivers. Note
that some ODBC native code and in many cases native database client code must
be loaded on each client machine that uses this type of driver. Hence, this
kind of driver is generally most appropriate when automatic installation and
downloading of a Java technology application is not important.
Type 2:
A native-API partly Java technology-enabled driver converts JDBC calls into
calls on the client API for Oracle, Sybase, Informix, DB2, or other DBMS. Note
that, like the bridge driver, this style of driver requires that some binary
code be loaded on each client machine.
Type 3:
A net-protocol fully Java technology-enabled driver translates JDBC API calls
into a DBMS-independent net protocol which is then translated to a DBMS
protocol by a server. This net server middleware is able to connect all of its
Java technology-based clients to many different databases. The specific
protocol used depends on the vendor. In general, this is the most flexible JDBC
API alternative. It is likely that all vendors of this solution will provide
products suitable for Intranet use. In order for these products to also support
Internet access they must handle the additional requirements for security,
access through firewalls, etc., that the Web imposes. Several vendors are
adding JDBC technology-based drivers to their existing database middleware
products.
Type 4:
A native-protocol fully Java technology-enabled driver converts JDBC technology
calls into the network protocol used by DBMSs directly. This allows a direct
call from the client machine to the DBMS server and is a practical solution for
Intranet access. Since many of these protocols are proprietary the database
vendors themselves will be the primary source for this style of driver. Several
database vendors have these in progress.
You still need to get and install a JDBC technology-enabled driver that supports the database that you are using. There are many drivers available from a variety of sources. You can also try using the JDBC-ODBC Bridge if you have ODBC connectivity set up already. The Bridge comes with the Java 2 SDK, Standard Edition, and Enterprise Edition, and it doesn't require any extra setup itself. The Bridge is a normal ODBC client. Note, however, that you should use the JDBC-ODBC Bridge only for experimental prototyping or when you have no other driver available.
There are two ways of achieving multi-threading : By implementing Runnable interface. By extending Thread class.
No. You can open only one Statement object per connection when you are using the JDBC-ODBC Bridge.
The JDBC-ODBC Bridge is bundled with the Java 2 SDK, Standard Edition, so there is no need to download it separately.
Ads By Google
© 2018 - JavaSpartans.com • All Rights Reserved