2.2_Database Interface: ODBC Basic Concepts

First, no ODBC era

In general, different database vendors have their own database development package, these development kit supports two modes of database development;

1. precompiled embedded mode (e.g. Oracle's ProC, SQL Server's ESQL)

2.API calls (such as Oracle's OCI)

Precompiled embedded mode: all write SQL statements within the program, and comply with certain rules, and the formation of C code by the database vendor's pre-compiler tool after treatment, and finally compiled by the C compiler

API call: database vendors provide a development kit, you can connect to the database through a variety of API functions, execute a query, modify, delete, manipulate the cursor, execute a stored procedure

The contrast between the two: pre-compiled drawback is that can not generate dynamic SQL statements; API calls to the program more freedom, but only against the same database.

It is seen from the figure above, those independent software suppliers, often written in a DBMS for each version of the application (for example, a database for version 1, version 2 of the database, the database version 3 ... ) Meanwhile, the interconnection between multiple database access has become a prominent issue!

To solve this problem, the more than thirty well-known software companies formed an organization, the purpose of this organization is to define a common basis for the implementation of SQL, so the members of the product can use it to exchange data with each other.

Two, ODBC era --- DBMS (database management system)

In 1994, Microsoft released a Windows operating system designed to achieve these standards, "the product" and the product became open database connectivity (Open Data Base Connection), that is ODBC. The basic idea in the following figure:

Compared with the traditional way. As shown below

In FIG, 2, 3 using a common application program interface (API) for access, as shown below:

如上图简化了开发维护难度,应用程序的目标代码能使用于不同的DBMS,把应用程序与底层网络环境和DBMS分开ODBC开放驱动程序管理模块,来接纳各个DBMS供应商(ORACLE、SYBASE、DB2等)提供符合ODBC规范标准的驱动程序,结构如下图:

 

Guess you like

Origin www.cnblogs.com/ximi07/p/11225668.html