ODBC and JDBC Comparison

Source: Internet
Author: User
Tags driver manager odbc

In learning the JDBC process of the Java EE, the new JDBC was immediately associated with ODBC, and we were able to affirm that there was a certain relationship between them. When I started to learn it, I thought it was a bit dizzy, so we looked at a lot of data and compared it with the more familiar ODBC.

Let's start by introducing ODBC and JDBC in each.

The ODBC(Open database Connectivity) is a set of standard APIs for access to databases. These APIs use SQL to complete most tasks, and it natively supports the SQL language to support the SQL that the user sends.

ODBC defines a set of specifications for the Access database API. These APIs are independent of the different DBMS and programming languages of actual performance.

That is, an ODBC-based application that operates on a database is not dependent on any DBMS. does not work directly with the DBMS, all database operations are completed by the corresponding DBMS's ODBC driver. Whether it's SQL Server, Access, or an Oracle database, you can use the ODBC API for an interview.

Thus, the greatest advantage of ODBC is the ability to handle all databases in a unified manner .

jdbc(Javadatabase Connectivity) is the interface specification for Java and the database, and JDBC defines a generic low-level API that supports standard SQL functionality. It consists of classes and interfaces written in the Java language, designed to allow database developers to provide standard database APIs for Java program apes.

The JDBC API defines a number of classes in Java that represent database connections, SQL directives, result sets, database metadata, and so on.

It agrees that the Java program Ape sends SQL instructions and processes the results.

In fact, JDBC and ODBC generally have a lot of other things in common :

For example, JDBC and ODBC are x/open -based SQL Call-level interface;

          Structurally speaking, the overall structure of JDBC is similar to odbc, both have four components: application, Driver Manager, driver, and data source working original   The rationale is also broadly the same.   

< Span style= "line-height:26px" >    In terms of content interaction. The JDBC maintains the basic characteristics of odbc also independent of a specific database and neither is     &NBSP;&NBSP;

The difference between them:

we know that ODBC is almost able to connect almost all of the databases on all platforms. Why doesn't Java use ODBC? The answer is: Java is able to use ODBC. But preferably in the form of Jdbc-odbc Bridge (Java connection is divided into two forms: Java direct and Jdbc-odbc Bridge). then why do you need JDBC? Because ODBC is not intended to be used directly in Java, it uses the C language interface. Calling local C code from Java has many drawbacks in terms of security, implementation, robustness, and the program's own proactive portability.

Literal translation from the ODBC C API to the Java API is undesirable.

For example, Java has no pointers. ODBC, however, has a very wide range of pointers (with a very easy error pointer "void *"). In addition, ODBC is more complex, while JDBC tries to ensure simplicity of simple functionality. Agree to use advanced features at the same time, if necessary.

Assume that you use ODBC. You must manually install the ODBC Driver Manager and drivers on each client computer.

Assuming that the JDBC driver is written entirely in Java, the JDBC code is automatically installed, ported, and secured on all Java platforms, from network computers to mainframes.

In short, JDBC is very much a reference to the ODBC, based on his development. JDBC retains the basic design characteristics of ODBC, so. Familiar with the ODBC program Ape will find JDBC very easy to use.

The biggest difference between them is that JDBC is based on Java style and strengths and is optimized. So it's easier to use.



ODBC and JDBC Comparison

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.