Installing and Configuring Database Access for DB2
There are two options to configure the DB2 client:
via the connection string, which corresponds to the setting DBName in the Bridge ...
... or on each client using the catalog database commands.
Configuring the DB2 Client via the Connection String
Install the DB2 drivers on your client system (IBM Data Server Driver for ODBC and CLI (CLI Driver). In the xUML Services Preferences of the Bridge, select the DB2 adapter preferences and enter the path to the database driver into DB2DIR.
The value of DB2INSTANCE is not used in this case.
Specify the DB2 server in the xUML Service Settings of the SQL adapter connection of the xUML service. All possible parameters are documented on the IBM documentation pages.
For more information on xUML service settings refer to xUML Service Settings.
Alternatively, you can also specify the DB2 server in the <<SQLAlias>> in the component diagram of the xUML service.
For more information on the SQL database deployment refer to section Using ODBC for Database Access in the Bridge Reference Guide.
Configuring DB2 Access via the SQL Client
For DB2, install the required DB2 client tools and define all necessary configuration parameter as described in the DB2 installation guide.
The DB2® Information Center provides access to all information that is needed to use the DB2 Information Management family of products and features for Linux, UNIX, and Windows operating systems (see IBM documentation pages).
1. Download the Actual Run-Time Client
Download the actual Run-Time Client Installer from the DB2 web site and install it. This documentation is based on version 8.
2. Open the Administration Shell
Open the DB2 administration shell, for example on Windows:C:\Program Files\IBM\SQLLIB\BIN\DB2CMD.exe DB2SETCP.BATDB2.EXE
3. Add a TCP/IP Node Entry to the Node Directory
Add a Transmission Control Protocol/Internet Protocol (TCP/IP) node entry to the node directory. The TCP/IP communications protocol is used to access the remote node. The CATALOG TCPIP NODE command is run on a client.
Example: db2 => catalog tcpip node DBSERVER remote dbserver1.e2e.ch server 50000
The DB2 node name DBSERVER holds the TCPIP entries for the system database directory.
DB2 Commands
Command | Description | Example |
---|---|---|
| Adds a Transmission Control Protocol/Internet Protocol (TCP/IP) node entry to the node directory. |
|
| Lists the contents of the system database directory. If a path is specified, the contents of the local database directory are listed. |
|
| Deletes an entry from the node directory. |
|
4. Store the Database Location Information in the System Database Directory
Stores database location information in the system database directory using the CATALOG DATABASE
command. The database can be located either on the local workstation or on a remote node.
Example: db2 => catalog database SAMPLE as SAMPLE at node DBSERVER
DB2 Commands
Command | Description | Example |
---|---|---|
| Lists the contents of the system database directory. |
|
| Deletes a database entry from the system database directory. |
|
Defining the DB2 Database Preferences on the Bridge
In a browser, open the Web-based user interface of the system, on which the Bridge is installed (see Checking the Installation). Enter a user id and password of a user with administration rights (the pre-defined user admin, for instance).
The welcome page is displayed.
In the Navigation, select the xUML Services item of the node instance you want to define the database preferences for and switch to tab Preferences:
Now, you can define the SQL adapter preferences for each database type. Select the DB2, Oracle, MySQL, or MSSQLServer Adapter in the drop down box and the parameters of the selected adapter are displayed.
Select the DB2 adapter, enter the following parameters and click Apply.
Key | Value | Example |
---|---|---|
DB2DIR | Full path to the DB2 SQL Library (installed with the DB2 client tool). | /opt/db2/odbc_cli/clidriver/lib/libdb2.so |
DB2INSTANCE | Name of the SQL service component that has to be used in the deployment diagram when defining a DB2 database backend, e.g. DB2. |
|
Related Documentation: