Building DB2CI applications
You can build DB2CI applications using an existing Oracle Call Interface (OCI) application and the bldapp script file.
Before you begin
- You must have a Db2® database with the same structure as the Oracle database used by your existing OCI application.
- You must have installed the IBM® Data Server Client.
About this task
Db2 samples provides a script called bldapp for compiling and linking applications that use OCI functions supported by the IBM Data Server Driver for Db2CI. It is located in the DB2DIR\samples\db2ci or DB2DIR/samples/db2ci directories, along with sample programs. DB2DIR represents the location where your Db2 copy is installed.
The bldapp script file takes
up to four parameters. The first parameter, $1
, specifies
the name of your source file. The additional parameters are only required
to build embedded SQL programs that requires a connection to the database:
the second parameter, $2
, specifies the name of the
database to which you want to connect; the third parameter, $3
,
specifies the user ID for the database, and $4
specifies
the password. If the program contains embedded SQL, indicated by the .sqc
extension,
then the embprep
script is called to precompile the
program, producing a program file with a .c
extension.
Restriction
- Ensure that your existing OCI application only has calls to OCI functions supported by the Db2CI driver. See IBM Data Server Driver for Db2CI for a complete list of supported OCI functions.