Application Building Guide
When you install the DB2 AD Client on Windows NT or Windows 2000, the
install program updates the configuration registry with the environment
variables INCLUDE, LIB, PATH, DB2PATH, and
DB2INSTANCE. The default instance is DB2.
For the Java environment variables updated by DB2, see "Windows 32-bit Operating Systems".
When you install the DB2 AD Client on Windows 98 or Windows 95, the install
program updates the autoexec.bat file.
You can override these environment variables to set the values for the
machine or the currently logged-on user. To override these values, use
any of the following:
- The Windows NT control panel
- The Windows 2000 control panel
- The Windows 95 or Windows 98 command window
- The Windows 95 or Windows 98 autoexec.bat file
Notes:
- Exercise caution when changing these environment variables. Do
not change the DB2PATH environment variable.
- When using the variable %DB2PATH% in a command, put the full
path in quotes, as in set LIB="%DB2PATH%\lib";%LIB%. In
DB2 Version 7.1 the default installation value for this variable is
\Program Files\sqllib, which contains a space, so not using quotes
may cause an error.
These environment variables can be updated for running most programs on
Windows 32-bit operating systems. In addition, you must take the
following specific steps for running DB2 applications:
- When building C or C++ programs, you must ensure that the
INCLUDE environment variable contains %DB2PATH%\INCLUDE
as the first directory.
For example, the Microsoft Visual C++ compiler environment setup
file, Vc\bin\vcvars32.bat, has the following command:
set INCLUDE=%MSVCDir%\INCLUDE;%MSVCDir%\MFC\INCLUDE;%MSVCDir%\ATL\INCLUDE;%INCLUDE%
To use this file with DB2, first move %INCLUDE%, which sets
the %DB2PATH%\INCLUDE path, from the end of the list to the
beginning, as follows:
set INCLUDE=%INCLUDE%;%MSVCDir%\INCLUDE;%MSVCDir%\MFC\INCLUDE;%MSVCDir%\ATL\INCLUDE;
- When building Micro Focus COBOL programs, set the COBCPY
environment variable to point to %DB2PATH%\INCLUDE\cobol_mf.
- When building IBM COBOL programs, set the SYSLIB environment
variable to point to %DB2PATH%\INCLUDE\cobol_a.
- Ensure the LIB environment variable points to %DB2PATH%\lib by
using:
set LIB="%DB2PATH%\lib";%LIB%
- Ensure that the DB2COMM environment variable is set at the
server of a remote database.
- Ensure that the security service has started at the server for SERVER
authentication, and at the client, depending on the level of CLIENT
authentication. To start the security service, use the NET START
DB2NTSECSERVER command.
Notes:
- All DB2 environment variables can be defined in the user's
environment or set up as registry variables. See the Administration Guide for information on registry variables. See the Command Reference for information on the db2set command.
- DB2INSTANCE should only be defined at the user environment level.
It is not required if you make use of the DB2INSTDEF registry variable which
defines the default instance name to use if DB2INSTANCE is not set.
- The database manager on a Windows NT or a Windows 2000 environment is
implemented as a Windows NT service or Windows 2000 service, and hence does
not return errors or warnings if the service is started successfully, though
other problems may have occurred. This means that when you run the
db2start or the NET START command, no warnings will be
returned if any communication subsystem failed to start. Therefore, the
user should always examine the Windows NT or Windows 2000 event logs, or the
DB2DIAG.LOG, for any errors that may have occurred during
the running of these commands.
[ Top of Page | Previous Page | Next Page ]