IBM Books

Application Building Guide


DB2 API Applications

Each DB2 SDK includes sample programs that call DB2 APIs. The "Building Applications" Chapters later in the book explain how to build the sample programs for the supported compilers using DB2 API build files supplied with the DB2 SDK for that platform. You can also use the makefiles that are supplied. Both the makefiles and the build files show you the compiler options you can use. These options are defined for each platform's supported compilers in the appropriate chapter. You might need to modify the options for your environment.

The following sample program is used in this book to demonstrate the steps for building and running DB2 API applications using the supported programming languages. The steps you follow may vary, depending on your environment:

client
demonstrates the use of the following APIs: SET CLIENT, and QUERY CLIENT

Links to the source code of this program are available for the following languages:

C
client.c

C++
client.C

COBOL
client.cbl

For a detailed description of all DB2 API sample programs, see Sample Program Tables.

The source files for DB2 API sample programs, where supported, are in the appropriate programming language subdirectory of sqllib/samples (UNIX), and %DB2PATH%\samples (OS/2 and Windows 32-bit operating systems).

After you build the sample programs, they can be used as templates to create your own applications. You can build the DB2 API programs using either the makefile or the build files provided.

The following list points you to where you can find building information for the DB2 API applications for the DB2 supported platforms and compilers:

AIX
IBM C: "DB2 API Applications"

IBM C Set++: "DB2 API Applications"

IBM VisualAge C+ C+: "DB2 API Applications"

IBM COBOL: "DB2 API Applications"

Micro Focus COBOL: "DB2 API Applications"

IBM XL Fortran: "DB2 API Applications"

HP-UX
HP C: "DB2 API Applications"

HP C++: "DB2 API Applications"

Micro Focus COBOL: "DB2 API Applications"

HP Fortran: "DB2 API Applications"

Linux
GNU/Linux gcc: "DB2 API Applications"

GNU/Linux gcc (C++): "DB2 API Applications"

OS/2
IBM VisualAge C++ Version 3: "DB2 API Applications"

IBM VisualAge C++ Version 4: "DB2 API Applications"

IBM VisualAge for COBOL: "DB2 API Applications"

Micro Focus COBOL: "DB2 API Applications"

Watcom Fortran 77: "DB2 API Applications"

Silicon Graphics IRIX
MIPSpro C: "DB2 API Applications"

MIPSpro C++: "DB2 API Applications"

MIPSpro Fortran-77: "DB2 API Applications"

Solaris
SPARCompiler C: "DB2 API Applications"

SPARCompiler C++: "DB2 API Applications"

Micro Focus COBOL: "DB2 API Applications"

SPARCompiler Fortran: "DB2 API Applications"

Windows 32-bit Operating Systems
Microsoft Visual C++: "DB2 API Applications"

IBM VisualAge for C++ Version 3.5: "DB2 API Applications"

IBM VisualAge for C++ Version 4.0: "DB2 API Applications"

Micro Focus COBOL: "DB2 API Applications"

IBM VisualAge for COBOL: "DB2 API Applications"


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]