Preparing the Db2 Environment
The CLI version of the Adapter for Db2 requires the installation of the Db2 Client. The CAF version requires Db2 load libraries. The JDBC version requires jar files to be installed. All versions of the adapter allow connection to local or remote Db2 servers.
Note: The Db2 Adapter for CAF is shipped with a DBRM, versioned with the Release and Gen number, for example 9.0.2. If you are using your own JCL for binding the DBRM in your Db2 PLAN, you may have to adjust your JCL, accordingly.
Set Up the Environment on Microsoft Windows
Two versions of the Adapter for Db2 are available in this environment. Each one requires different pre-configuration steps prior to using the WebFOCUS Reporting Server browser interface.
Db2 CLI:
The adapter supports Unicode data. You must add DB2CODEPAGE=1208 to the Windows environment either by:
- Setting the environment variable in Windows.
- Setting the environment variable in the edaenv.cfg file.
DB2CODEPAGE=1208
Db2 JDBC:
Identify the location of the JDBC Driver files by adding them to the environment variable CLASSPATH before server startup. For example, set:
CLASSPATH=c:\usr\driver_files\mydriver.jar:%CLASSPATH%
Set Up the Environment on UNIX
Two versions of the Adapter for Db2 are available in this environment. Each one requires different pre-configuration steps prior to using the WebFOCUS Reporting Server browser interface.
Db2 CLI:
- Specify the Db2 instance to access using the UNIX environment variable $DB2INSTANCE.
For example:
export DB2INSTANCE=db2
- Specify the location
of the Db2 instance you wish to access using the UNIX environment
variable $INSTHOME. For example:
export INSTHOME=/usr/db2
- Specify the path
to the Db2 shared library using the UNIX environment variable $LD_LIBRARY_PATH.
For example:
export LD_LIBRARY_PATH=$INSTHOME/sqllib/lib:$LD_LIBRARY_PATH
Note that if the server is running with security on, the LD_LIBRARY_PATH variable is ignored. In this case, you must use IBI_LIBPATH.
- Unicode support. The adapter supports Unicode data. You must set the LANG environment variable in the edastart
file or in a separate shell file. For example, for American English,
you would export the following variable:
export LANG=EN_US.UTF-8
To take advantage of adapter support for Unicode data, the WebFOCUS Reporting Server must be configured with code page 65001.
Db2 JDBC:
Identify the location of the JDBC Driver files by adding them to the environment variable CLASSPATH before server startup. For example, issue the following commands:
CLASSPATH=/usr/driver_files/mydriver.jar; $CLASSPATH export CLASSPATH ...
Set Up the Environment on z/OS
Two deployment options are supported on this platform that support the CLI and CAF versions of the adapter. Each one requires different pre-configuration steps prior to using the WebFOCUS Reporting Server browser interface.
- Db2/CAF: Utilizes
embedded SQL using the IBM/Db2 for z/OS Call Attach Facility to
access the Db2 RDBMS.
- For HFS deployment. The WebFOCUS Reporting Server browser interface configuration panel for the bind operation has three options (Yes, Create JCL only, and No). Select Yes to execute a shell script ($EDAHOME/bin/genidb2.sh) to bind your plan to Db2. If you do not have bind authority over the Db2 subsystem, then select Create JCL only so that your Db2 DBA can run member GENDB2 in the configuration data set for you. Select No if you do not want to run the bind script or create the JCL. The Adapter for Db2 can now be used.
- For PDS deployment. The WebFOCUS Reporting Server browser interface configuration panel for the bind operation will only create the JCL member GENDB2 in the configuration data set. This job will have to be submitted by your Db2 DBA to bind the plan to Db2 before the Db2 adapter can be used.
For the naming convention for the configuration data set, see the installation manual for z/OS.
- Db2/CLI: Utilizes
IBM/Db2 for z/OS Call Level Interface calls to access the Db2 RDBMS.
The adapter makes use of the Db2 plan DSNACLI. To ensure that all users of the adapter have access to this plan, issue the following command in the Db2 environment:
GRANT EXECUTE ON PLAN DSNACLI TO PUBLIC
The adapter also uses the DSNAOINI environment variable or DSNAOINI DDNAME pointing to the Db2 CLI initialization file. You can provide this variable at installation time using the ISETUP panels, or you can add the variable manually to the EDAENV member of the installation data set after completing the installation.
The following is an example for the DSNAOINI environment variable.
DSNAOINI=full_path_name/db2cli.iniThe following is an example for the DSNAOINI DDNAME.
//DSNAOINI DD DSN=library(member),DISP=SHR
or
//DSNAOINI DD DSN=dataset,DISP=SHRUnicode support. The adapter supports Unicode data in Db2 databases that have been created with the CCSID UNICODE option. You must ensure that the DSNAOINI environment variable or DDNAME points to a configuration file containing the following specification:
CURRENTAPPENSCH=UNICODE
Access a Remote Database Server on IBM i
Using the standard rules for deploying the Db2 CLI Client, the server supports connections to:
- Local Db2 servers.
- Remote Db2 servers.
When using Db2/CLI to connect to a remote Db2 data source, the Db2 client catalog must contain an entry for the node where the remote data source resides and an entry for the remote database name.
Support for Remote Aliases. An alias entry in a local Db2 system that points to a table in another Db2 system is only supported with the CREATE SYNONYM command. It is not supported for metadata queries when SET ENGINE=DB2 is in effect.