Connecting to a DB2 data source
iHub can connect from designs to IBM DB2 data sources on Linux and Windows using run-time client version 9.7. To connect to DB2 data sources, you must perform the following tasks:
*Define appropriate environment variables.
*Specify the database environment.
*Supply an account name and password.
*Specify the protocol your site uses.
*Configure the DB2 client’s locale setting to match the locale of the machine.
The Actuate interface to DB2 clients supports DB2 stored procedures. The following limitations of DB2 stored procedures exist:
*DB2 does not support large object (LOB) data types between versions. See the DB2 documentation for information about DB2 support for LOB data types.
*You must bind the DB2 CLI packages from the client system to the DB2 server using db2cli.lst in some situations. For example, after you apply a Fix Pak to a client or server, or on a system where an Actuate design uses DB2 9.1 client software with a DB2 9.1 server.
Defining DB2 environment variables
For Linux and Microsoft Windows operating systems, you must define the following environment variables:
*DB2INSTANCE and DB2DIR
Define these variables to connect to a DB2 instance. DB2INSTANCE specifies the instance name, and DB2DIR is the path to the DB2 client installation.
*DB2CODEPAGE
DB2CODEPAGE is a DB2-specific environment variable. For Windows and Linux, Actuate uses DB2CODEPAGE to determine the DB2 database’s client locale. On Windows systems, DB2CODEPAGE is a registry setting. On Linux systems, DB2CODEPAGE is an environment variable. At execution time when Actuate connects to a DB2 data source, the active code page is in effect for the duration of the connection. All data is interpreted based on this code page. If this variable is not set, Actuate’s DBMS module determines the client locale setting from the operating system locale.
Use db2set to set DB2CODEPAGE. For example, the following command sets the DB2 database client to retrieve data in UTF‑8 format:
db2set DB2CODEPAGE=1208
When using the db2set command, add the location of db2set to the environment variable PATH. For example, if db2set is in $DB2DIR/adm and you use db2set in the pmd11.sh shell script, add the location of db2set to the environment variable PATH in pmd11.sh.
About the HP-UX11i Version 1 library path
The definition of the HP-UX11i in the environment variable SHLIB_PATH must put the path to ODBC and DB2 libraries before the AC_SERVER_HOME path. For example, if ODBC/lib and DB2DIR/lib are paths to the ODBC and DB2 libraries, use the following SHLIB_PATH definition:
SHLIB_PATH=$ODBC/lib:$DB2DIR/lib:$AC_SERVER_HOME/lib:usr/local/bin:
Using DB2 libraries on HP-UX
If you did not specify DB2 data source information during installation of iHub, and you now want to use DB2 data source connections from the machine, you must create a symbolic link to the DB2 library in the DB2 client installation directory.
Linking to a DB2 library on HP-UX
Create a symbolic link DB2CLI.sl in AC_SERVER_HOME/lib to the DB2 library libdb2.sl.
Checking a connection to a DB2 instance
To check that a connection exists between the machine and the DB2 instance, use the command-line utility DB2. This utility comes with the DB2 software and is available for Linux, and Windows.
To start the DB2 utility, open a command-line window and enter DB2 at the command prompt. At the DB2 prompt, enter the command to connect to a DB2 database.
connect to <database> user <user name>
The <database> is the name of the DB2 database, and <user name> is the DB2 database user. You are prompted for a password. Enter the password for the user. DB2 displays the connection information in the command window when a connection is made. Enter quit to terminate the session.
About using XML Extender
The XML Extender component of DB2 provides data types to store XML documents and DTDs in DB2 databases as either an XML column or XML collection. Actuate retrieves the XML column data as string data. DB2 stores an XML collection as a set of tables. Actuate retrieves data from the set of DB2 tables.