DB2 CLI. In addition, some DB2 specific extensions have been added to DB2 CLI to facilitate programming with DB2 features. It conforms to ODBC 3.51.

Comparison of CLI and ODBC

The roles played by the DB2 CLI and ODBC driver might change due to the differences in application environments.

Figure 4-1illustrates the roles played by DB2 CLI and ODBC driver in different environments. When an application accesses a DB2 database through an ODBC driver manager, the DB2 CLI and ODBC driver behaves as an ODBC driver just like other ODBC drivers, shown as A and B. The calls that the application sends to the DB2 database have to go through the ODBC Driver Manager, DB2 ODBC driver, and DB2 client before it can reach the DB2 server. Mapping and transformation are made to these calls during the process. This is shown in the left side of the diagram.

In the right side of Figure 4-1,when application calls DB2 CLI specifications, there is no ODBC Driver Manager or other driver manager participating in the action. The calls to a DB2 server are passed to the local DB2 Client immediately by the DB2 CLI driver and the DB2 Client will communicate with the DB2 server and forward the calls to it. As opposed to the ODBC environment, in here, DB2 CLI driver looks as if it is working as both driver manager and underlying driver.

ODBC Driver Manager

DB2 CLI

 

Environment

 

Environment

 

Application

 

Application

 

 

 

ODBC Driver Manager

 

 

 

 

DB2

Other

Other

 

CLI

DB2

driver

ODBC

ODBC

ODBC

 

driver

driver

 

driver

 

A

B

 

DB2

DB2

 

 

 

Gateway

Client

server

DBMS

DB2

 

B

Client

 

A

DB2 connect

 

 

 

 

 

DB2

 

 

 

Server

 

 

 

DB2 connect

DB2

 

 

 

Mainframe/AS 400

Figure 4-1 ODBC vs. CLI

Chapter 4. Deploying applications with DB2 155

Page 169
Image 169
IBM DB2 manual Comparison of CLI and Odbc, Odbc vs. CLI