Chapter 4. Deploying applications with DB2 149
Set the system environment variables:
Set the system environment variable LIBPATH on AIX or
LD_LIBRARY_PATH on the Linux, UNIX, and Windows systems to the
directory where the driver is installed.
On Linux or UNIX systems, run the following command:
export LD_LIBRARY_PATH=$HOME/db2_cli_odbc_driver/clidriver/lib
On Windows systems, set the variable using the following command:
set LD_LIBRARY_PATH=<clidriver_path>\lib
This step is not necessary if your application is statically linked to or
dynamically loads the driver library (db2cli.dll on Windows systems, or
libdb2.a on other systems) with the fully qualified name.
On Windows, add the lib and bin directory to the PATH by issuing the
following command.
set PATH=<clidriver_path>\bin;<clidriver_path>\lib;%PATH%
򐂰Register with DTC:
If your applications are participating in transactions managed by Microsoft
Distributed Transaction Coordinator (DTC), you must register with DTC.
Run the db2oreg1.exe utility located at path <clidriver path>/bin:
db2oreg1.exe -i
To list the parameters taken, and how to use them, run the utility with the -h
option:
db2oreg1.exe -h
Note: Setting these environment variables might break existing
applications, if there are multiple versions of the driver installed on the
same machine, or if there are other DB2 version 9 products installed on
the same machine. Ensure that the environment variables are
appropriate for all the applications under the same scope before setting
them.
Note: The db2oreg1.exe utility makes changes to the Windows registry
when you run it after installing the driver. If you uninstall the driver, you
should run the utility again to undo these changes.
db2oreg1.exe -u