Call Level Interface Guide and Reference

Application Development Environments

DB2 CLI application development support is provided when you install a DB2 Application Development Client. The DB2 Application Development Client requires the same initial runtime setup as any other DB2 client. Before using the DB2 CLI development environment, you may want to verify that your environment is set up correctly by following these steps:

If there are no databases cataloged, or the connect fails refer to the Quick Beginnings book for your platform for information about configuring the environment.

Once a connection has been confirmed, proceed with compiling the sample application.
Note:There is also an applet referred to as "Interactive CLI" or db2cli in the DB2 CLI samples directory. Refer to the INTCLI.DOC file in the same directory for more information on this programmer's utility that is used to design and prototype CLI function calls.

Compiling a Sample Application

DB2 CLI includes various sample applications located in the following location:

The README file in the same directory lists each sample along with an explanation, and describes how to build the samples using the makefile and build files provided. All of the DB2 CLI samples are listed in Appendix J, CLI Sample Code.

The Application Building Guide provides information for compiling, linking, and running DB2 CLI applications and stored procedures on all DB2-supported operating systems. See the section DB2 Call Level Interface (CLI) Applications in that book for complete details and examples.

If you are migrating applications from previous versions of DB2 CLI, refer to Incompatibilities for additional information.
Note:The order in which the compiler searches for include (header) files can be significant if there are two or more files with the same name, (for example sql.h and sqlext.h are included in some ODBC SDK environments).

If you are building only DB2 CLI applications, always put the DB2 include path before any others.

If you are building ODBC applications, your build environment may require further customization in order to use the correct include files. Refer to the ODBC SDK documentation for more information.

Compile and Link Options

Refer to the Application Building Guide for information on compiling and linking the samples for your particular platform. A make file and build script are also supplied that have the correct options for the platform and supported compilers. These files are located in the sqllib\samples\cli (or sqllib/samples/cli) subdirectory.
Note:There may be platform or compiler specific link options required for some types of CLI applications. Refer to the Application Building Guide for complete details.


[ Top of Page | Previous Page | Next Page ]