The ODBC interface

 

In 1991, Microsoft Corporation developed a callable SQL interface, known as Open Database Connectivity (ODBC), for the Microsoft Windows operating system. Earlier versions of the ODBC interface were modeled directly from a preliminary draft of the original X/Open CLI interface and from the SAG SQL CAE specification. The ODBC interface defines an operating environment where a database specific library, or driver, is required for each data source that supports it. A driver implements the functions in the ODBC API and it is dynamically loaded (based on the database name provided with the connection request) at application run time by an ODBC Driver Manager. When the application is executed, the ODBC Driver Manager receives its ODBC API function calls and routes them to the appropriate data source-specific driver. By using drivers, an application can be linked directly to a single ODBC driver library, rather than to several data source-specific libraries. To use a different driver, the application does not need to be recompiled or relinked. Instead, it simply loads the new driver and calls the ODBC API functions stored there. If the application needs to access multiple data sources simultaneously, it simply loads multiple drivers. The actual format of an ODBC driver is operating system–specific. For example, on the Windows 95 and Windows NT operating system, drivers are treated as dynamic-link libraries (DLLs).

 

Because of the conformance of ODBC to the X/Open and ISO standards, an application written to the X/Open and ISO specifications will work with an ODBC 3.5 driver or a standard-compliant driver when: (a) it is compiled with the ODBC 3.5 header files and linked with ODBC 3.5 libraries, and (b) when it gains access to the driver through the ODBC 3.5 Driver Manager.

 

As can be seen, the ODBC interface standardizes database access by following a set of guidelines:

 

 

It is important to remember that ODBC defines a common interface for all of the features it exposes. Because of this, applications contain feature-specific code, not DBMS-specific code, and can use any drivers that expose those features. One advantage of this is that applications do not need to be updated when the features supported by a DBMS are enhanced. Instead, when an updated driver is installed, the application automatically uses the features because its code is feature-specific, not driver or DBMS specific.