IBM Books

Application Building Guide


Embedded SQL Applications

Note:Embedded SQL for Java (SQLJ) is not discussed here, but is fully discussed in Chapter 4, "Building Java Applets and Applications".

Each DB2 SDK includes sample programs that embed SQL statements. The "Building Applications" Chapters later in the book explain how to build the sample programs for the supported compilers using 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.

When you run a build file to build a sample program containing embedded SQL, the build file executes the following steps:

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

updat
uses static SQL to update a database.

outcli
is the client program of a client/server example; the server program is outsrv.

outsrv
is the server program of a client/server example; the client program is outcli.

calludf
uses the functions created by the user-defined function program, udf.

Links to the source code of these programs are available for the following languages:

C
updat.sqc , outcli.sqc , outsrv.sqc , calludf.sqc

C++
updat.sqC , outcli.sqC , outsrv.sqC , calludf.sqC

COBOL
updat.sqb , outcli.sqb , outsrv.sqb

For a more detailed description of these sample programs, see Sample Program Tables.

The source files for these sample programs, where supported, are in the appropriate programming language subdirectory of sqllib/samples on UNIX, and %DB2PATH%\samples on 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. This can be done by modifying the sample programs with your own SQL statements. You can build your programs using either the makefile or the build files provided.

"Sample Programs" lists all of the sample programs. The Application Development Guide explains how the samples containing embedded SQL work.

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

AIX IBM C
"Embedded SQL Applications" and "Embedded SQL Stored Procedures".

AIX IBM C Set++
"Embedded SQL Applications" and "Embedded SQL Stored Procedures".

AIX IBM VisualAge C++
"Embedded SQL Applications" and "Embedded SQL Stored Procedures".

AIX IBM COBOL
"Embedded SQL Applications" and "Embedded SQL Stored Procedures".

AIX Micro Focus COBOL
"Embedded SQL Applications" and "Embedded SQL Stored Procedures".

AIX IBM XL Fortran
"Embedded SQL Applications" and "Embedded SQL Stored Procedures".

HP-UX C
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

HP-UX C++
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

HP-UX Micro Focus COBOL
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

HP-UX Fortran
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

GNU/Linux gcc (C)
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

GNU/Linux gcc (C++)
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

OS/2 IBM VisualAge Version 3 for C++
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

OS/2 IBM VisualAge Version 4 for C++
"Embedded SQL Applications" and "Embedded SQL Stored Procedures".

OS/2 IBM VisualAge for COBOL
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

OS/2 Micro Focus COBOL
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

OS/2 Fortran 77
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

Silicon Graphics IRIX MIPSpro C
"Embedded SQL Applications"

Silicon Graphics IRIX MIPSpro C++
"Embedded SQL Applications"

Silicon Graphics IRIX MIPSpro Fortran-77
"Embedded SQL Applications"

Solaris SPARCompiler C and IBM C
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

Solaris SPARCompiler C++ and IBM C Set++
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

Solaris Micro Focus COBOL
"Embedded SQL Applications"

Solaris SPARCompiler Fortran
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

Windows 32-bit Operating Systems Microsoft Visual C++
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

Windows 32-bit Operating Systems IBM VisualAge Version 3.5 for C++
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

Windows 32-bit Operating Systems IBM VisualAge Version 4.0 for C++
"Embedded SQL Applications" and "Embedded SQL Stored Procedures".

Windows 32-bit Operating Systems Micro Focus COBOL
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"

Windows 32-bit Operating Systems IBM VisualAge for COBOL
"Embedded SQL Applications" and "Embedded SQL Stored Procedures"


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

[ DB2 List of Books | Search the DB2 Books ]