Db2 ODBC background information

The Db2 ODBC interface allows you to create portable applications. The interface also allows you to load drivers dynamically at run time.

To understand Db2 ODBC or any callable SQL interface, you should understand what it is based on, and to compare it with existing interfaces.

The X/Open Company and the SQL Access Group jointly developed a specification for a callable SQL interface referred to as the X/Open Call Level Interface. The goal of this interface is to increase the portability of applications by enabling them to become independent of any one database product vendor's programming interface. Most of the X/Open Call Level Interface specification was accepted as part of the ISO Call Level Interface Draft International Standard (ISO CLI DIS).

Microsoft developed a callable SQL interface called Open Database Connectivity (ODBC) for Microsoft operating systems based on a preliminary draft of X/Open CLI. The Call Level Interface specifications in ISO, X/Open, ODBC, and Db2 ODBC continue to evolve in a cooperative manner to provide functions with additional capabilities.

The ODBC specification also includes an operating environment where data source specific ODBC drivers are dynamically loaded at run time by a driver manager based on the data source name provided on the connect request. The application is linked directly to a single driver manager library rather than to each database management system's library. The driver manager mediates the application's function calls at run time and ensures they are directed to the appropriate ODBC driver.

The ODBC driver manager only knows about the ODBC-specific functions, that is, those functions supported by the database management system for which no API is specified. Therefore, functions that are specific to one database management system cannot be directly accessed in an ODBC environment. However, dynamic SQL statements that are specific to a database management system are indirectly supported using a mechanism called the vendor escape clause.

ODBC is not limited to Microsoft operating systems. Other implementations are available, such as Db2 ODBC, or are emerging on various platforms.