Open Database Connectivity (ODBC)是一个广泛使用的数据库访问API。ODBC 3.x 已完全符合Open Group和ISO/IEC 发行的数据库API Call-Level Interface (CLI) 规范,并实现了上述标准之外的一些功能。
ODBC的设计目标是最大限度的互通性,也就是写一份源码能访问多种DBMS。ODBC提供了一个统一的方法来访问不同的或者说异构的DBMS
ODBC is designed for maximum interoperability - that is, the ability of a single application to access different database management systems (DBMSs) with the same source code. Database applications call functions in the ODBC interface, which are implemented in database-specific modules called drivers. The use of drivers isolates applications from database-specific calls in the same way that printer drivers isolate word processing programs from printer-specific commands. Because drivers are loaded at run time, a user only has to add a new driver to access a new DBMS; it is not necessary to recompile or relink the application.
The functions in the ODBC API are implemented by developers of DBMS-specific drivers. Applications call the functions in these drivers to access data in a DBMS-independent manner. A Driver Manager manages communication between applications and drivers.
ODBC架构
Application
Performs processing and calls ODBC functions to submit SQL statements and retrieve results.
Driver Manager
Loads and unloads drivers on behalf of an application. Processes ODBC function calls or passes them to a driver.
Driver
Processes ODBC function calls, submits SQL requests to a specific data source, and returns results to the application. If necessary, the driver modifies an application's request so that the request conforms to syntax supported by the associated DBMS.
Data Source
Consists of the data the user wants to access and its associated operating system, DBMS, and network platform (if any) used to access the DBMS.