The difference between JDBC and ODBC

Source: Internet
Author: User
Tags driver manager

I.ODBC(Open database Connectivity: Open data base connection)


ODBC Overall structure
Application Program
Executes processing and calls an ODBC function, submits the SQL statement and retrieves the result

Driver Manager
Manage communication between applications and drivers, load and unload drivers based on the application,
Handle ODBC function calls and get them routed to the driver

Driver Program
Handles ODBC function calls, submits SQL statements to the data source, and returns the results to the application, if necessary,
The driver modifies an application request so that the request is consistent with the syntax supported by the associated DBMS

Data source
The DBMS that the user wants to access, and the associated
|                   | |
Data source data source data source



The high-level development workflow combined with reality is as follows:
1. The data application system first obtains the DSN established in the ODBC Data Source Manager (the details that store the connection to the data provider include the database location, the database type, and the corresponding ODBC driver, etc.), and then Driver The manager relies on a technology called database indepedent Communications technology to connect with the data source, which involves both the client and the server The problem of multiple agent objects, the details are not classified, see ).


2.Driver Mangaer calls a specific ODBC driver to convert the ODBC standard API into a function call for a specific database system (where the database features are also translated here, such as the SQL syntax differences), and then sent to the data source via the request agent of the client .
3. Data source database Agent processing operation, the result is returned to the client request Agent, and then up through Driver (here will have the behavior of translation and normalization error code), Driver Mangaer returned to Application.

It is necessary to define and manipulate the cursor, maintain the transaction, and be responsible for any interaction with the necessary software layer that accesses the data source (including software that interfaces with the underlying network or file system) and is also done by the driver ..

Describe the workflow in conjunction with the ODBC API call sequence: Initialize (assign environment---> Assign connection handle---> Connect to Server---> Assign statement handle)-------->sql processing (statement processing and retrieval parts)--------> terminating (Release statement handle---> Disconnect from server---> Release connection handle---> Release environment ).

Second,JDBC(Java database Connectivity:java connection)




JDBCMany of the designs are borrowed from ODBC:
Both 1.JDBC and ODBC are x/open-based SQL call-level interfaces
2.JDBC Many design ideas follow ODBC, including many abstractions and SQL CLI implementations
The overall structure of the 3.JDBC is similar to ODBC, with four components: application, Driver Manager, driver, and data source, which works in roughly the same ODBC.

1.JDBC maintains the basic nature of ODBC and is independent of specific databases .
2. Applications that use the same source code can access different DBMS by dynamically loading different JDBC drivers. When connecting to different DBMS, each DBMS is identified only by a different URL .
The 3.JDBC DatabaseMetaData interface provides a range of methods to check the DBMS's support for specific features and determine what features are in order to support the characteristics of a particular database
4.JDBC also supports multiple database connections in the application, and JDBC makes it easy to access multiple heterogeneous databases with SQL statements at the same time, laying the groundwork for interoperability between heterogeneous databases

There are four types of Java drive solutions : 1. Jdbc-odbc Bridge 2. Native api/group Java Driver 3. Network protocol /Full Java 4. Native protocol/full Java

The difference between JDBC and ODBC

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.