# IBM DB2

This article outlines the integration with the IBM DB2 connector, enabling streamlined metadata management through features such as crawling, profiling, querying, data preview, and lineage building (both automatic and manual). It also ensures secure authentication via Credential Manager.

<figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FqMFgommzTjq9RBwXCsGb%2Fimage.png?alt=media&#x26;token=40cec045-f65a-4bf2-ba74-cee3cff7577e" alt=""><figcaption></figcaption></figure>

## Overview

### Connector Details

<table data-header-hidden><thead><tr><th width="476.5"></th><th></th></tr></thead><tbody><tr><td>Connector Category</td><td>RDBMS</td></tr><tr><td>Connector Version</td><td>Release7.1.1</td></tr><tr><td>Releases Supported (Available from)</td><td>Legacy Connector</td></tr><tr><td><p>Connectivity</p><p>[How the connection is established with the RDBMS System]</p></td><td>JDBC driver</td></tr><tr><td>Verified IBM DB2 Version</td><td>11.1.4.4</td></tr></tbody></table>

{% hint style="info" %}
The IBM DB2 connector has been validated with the mentioned "Verified IBM DB2 Versions" and is expected to be compatible with other supported IBM DB2 versions. If there are any issues with validation or metadata crawling, please submit a support ticket for investigation and feedback.
{% endhint %}

### Connector Features

| Feature                                      | Availability |
| -------------------------------------------- | :----------: |
| Crawling                                     |       ✅      |
| Delta Crawling                               |       ❌      |
| Profiling                                    |       ✅      |
| Query Sheet                                  |       ✅      |
| Data Preview                                 |       ✅      |
| Auto Lineage                                 |       ✅      |
| Manual Lineage                               |       ✅      |
| Secure Authentication via Credential Manager |       ✅      |
| Data Quality                                 |       ✅      |
| DAM (Data Access Management)                 |       ❌      |
| Bridge                                       |       ✅      |

### Metadata Mapping

The following objects are crawled from DB2 and mapped to the corresponding UI assets.

| DB2 Object             | DB2 Attribute | OvalEdge Attribute | OvalEdge Category    | OvalEdge Type      |
| ---------------------- | ------------- | ------------------ | -------------------- | ------------------ |
| Schema                 | SCHEMANAME    | schema             | Databases            | Schema             |
| Table                  | TABNAME       | Table              | Tables               | table              |
| Table                  | TYPE          | Type               | Tables               | table              |
| Table                  | REMARKS       | Source Description | Descriptions         | Source Description |
| Columns                | colname       | Column             | Table Columns        | Columns            |
| Columns                | TYPENAME      | Column Type        | Table Columns        | Columns            |
| Columns                | colname       | Title              | Table Columns        | Columns            |
| Columns                | REMARKS       | Source Description | Table Columns        | Columns            |
| Columns                | LENGTH        | Length             | Table Columns        | Columns            |
| Columns                | COLNO         | Column Position    | Table Columns        | Columns            |
| Columns                | NULLS         | Nullable           | Table Columns        | Columns            |
| Views                  | VIEWNAME      | View               | Tables               | view               |
| Views                  | TEXT          | View Query         | Views                | View               |
| Views                  | VIEWSCHEMA    | Schema             | Views                | View               |
| Procedures & Functions | ROUTINENAME   | Name               | Procedures/Functions | Procedure/Function |
| Procedures & Functions | TEXT          | Query              | Procedures/Functions | Procedure/Function |
| Procedures & Functions | ROUTINETYPE   | Job Type           | Procedures/Functions | Procedure/Function |
| Procedures & Functions | ROUTINESCHEMA | Schema             | Procedures/Functions | Procedure/Function |

## Set up a Connection

### Prerequisites

The following are the prerequisites to establish a connection:

#### **External Supporting File**

{% hint style="info" %}
The supporting file listed below is required for establishing a DB2 database connection using JDBC. Ensure that the correct supporting file is used based on the specific installation environment. The supporting file is available for download. After downloading, place the file in the appropriate directory to proceed. To download the ZIP file, click [here](https://docs.ovaledge.com/connectors/connector-supporting-files).
{% endhint %}

<table><thead><tr><th width="218">File Name</th><th>Description</th></tr></thead><tbody><tr><td>db2jcc4-10.1.jar</td><td>Use this file to enable DB2 JDBC connectivity for the application. Place the JAR file in the <strong>Third Party Jars</strong> or <strong>external JAR directory (ovaledge.jarpath)</strong> and restart the application to load the driver successfully.</td></tr></tbody></table>

**Whitelisting Ports**

Ensure the inbound port “50005” is whitelisted for OvalEdge to connect to the DB2 database.

{% hint style="warning" %}
The default port number for DB2 is 50005. If a different port is used, ensure that the updated port number is specified during connection setup, the port is whitelisted, and communication between the system and DB2 is properly established.
{% endhint %}

**Service Account User Permissions**

{% hint style="warning" %}
It is recommended to use a separate service account to establish the connection to the data source, configured with the following minimum set of permissions.
{% endhint %}

{% hint style="info" %}
👨‍💻 Who can provide these permissions? These permissions are typically granted by the DB2 administrator, as users may not have the required access to assign them independently.
{% endhint %}

| Objects                | System Tables                         | Access Permission |
| ---------------------- | ------------------------------------- | ----------------- |
| Schema                 | Syscat.Schemata                       | Select            |
| Tables                 | Syscat.Tables                         | Select            |
| Table Columns          | Syscat.Columns                        | Select            |
| Relationships          | Syscat.Keycoluse, Syscat.References   | Select            |
| Views                  | Syscat.Views                          | Select            |
| Procedures & Functions | Syscat.Routines                       | Select            |
| Schema Users           | Syscat.Schemata, Sysibmadm.Privileges | Select            |
| Table Users            | Syscat.Tabauth, Sysibmadm.Privileges  | Select            |

### Connection Configuration Steps

{% hint style="warning" %}
Users are required to have the Connector Creator role in order to configure a new connection.
{% endhint %}

1. Log into OvalEdge, go to Administration > Connectors, click **+ (New Connector)**, search for **DB2**, and complete the required parameters.

{% hint style="info" %}
Fields marked with an asterisk (\*) are mandatory for establishing a connection.
{% endhint %}

<table><thead><tr><th width="219.83331298828125">Field Name</th><th>Description</th></tr></thead><tbody><tr><td>Connector Type</td><td>By default, "DB2" is displayed as the selected connector type.</td></tr><tr><td>Credential Manager*</td><td><p>Select the desired credentials manager from the drop-down list. Relevant parameters will be displayed based on your selection.</p><p>Supported Credential Managers:</p><ul><li>OE Credential Manager</li><li>AWS Secrets Manager</li><li>HashiCorp Vault</li><li>Azure Key Vault</li></ul></td></tr><tr><td>License Add Ons</td><td><p></p><ul><li>Select the checkbox for Auto Lineage Add-On to build data lineage automatically.</li><li>Select the checkbox for Data Quality Add-On to identify data quality issues using data quality rules and anomaly detection.</li></ul></td></tr><tr><td>Connector Name*</td><td><p>Enter a unique name for the DB2 connection              </p><p>(Example: "DB2_Prod").</p></td></tr><tr><td>Connector Environment</td><td>Select the environment (Example: PROD, STG) configured for the connector.</td></tr><tr><td>Catalog SYS Schemas*</td><td>Select True to include DB2 system schemas in metadata cataloging, or select False to exclude system schemas and catalog only user-defined schemas.</td></tr><tr><td>Connector description</td><td>Enter a brief description of the connector.</td></tr><tr><td>Server*</td><td>Enter the DB2 database server name or IP address (Example: xxxx-xxxx.xxxx4ijtzasl.xx-south-1.rds.amazonaws.com or 1xx.xxx.1.x0).</td></tr><tr><td>Port*</td><td>By default, the port number for the DB2, "50005" is auto-populated. If required, the port number can be modified as per custom port number that is configured for the DB2.</td></tr><tr><td>Database*</td><td>Enter the database name to which the service account user has access within the DB2.</td></tr><tr><td>Driver*</td><td>By default, the DB2 driver details are auto-populated. </td></tr><tr><td>Username*</td><td>Enter the service account username set up to access the DB2 database (Example: "oesauser").</td></tr><tr><td>Password*</td><td>Enter the password associated with the service account user.</td></tr><tr><td>Connection String</td><td><p>Configure the connection string for the DB2 database:</p><ul><li>Automatic Mode: The system generates a connection string based on the provided credentials.</li><li>Manual Mode: Enter a valid connection string manually.</li></ul><p>Replace placeholders with actual database details.</p><p>{sid} refers to Database Name.</p></td></tr><tr><td>Plugin Server</td><td>Enter the server’s name when running as a plugin server.</td></tr><tr><td>Plugin Port</td><td>Enter the port number on which the plugin is running.</td></tr></tbody></table>

**Default Governance Roles**

<table data-header-hidden><thead><tr><th width="219.8333740234375"></th><th></th></tr></thead><tbody><tr><td>Default Governance Roles*</td><td>Select the appropriate users or teams for each governance role from the drop-down list. All users and teams configured in OvalEdge Security are displayed for selection.</td></tr></tbody></table>

**Admin Roles**

<table data-header-hidden><thead><tr><th width="219.8333740234375"></th><th></th></tr></thead><tbody><tr><td>Admin Roles*</td><td>Select one or more users from the dropdown list for Integration Admin and Security &#x26; Governance Admin. All users configured in OvalEdge Security are available for selection.</td></tr></tbody></table>

**No of Archive Objects**

<table data-header-hidden><thead><tr><th width="219.8333740234375"></th><th></th></tr></thead><tbody><tr><td>No Of Archive Objects*</td><td><p>This shows the number of recent metadata changes to a dataset at the source. By default, it is off. To enable it, toggle the Archive button and specify the number of objects to archive.</p><p>Example: Setting it to 4 retrieves the last four changes, displayed in the 'Version' column of the 'Metadata Changes' module.</p></td></tr></tbody></table>

**Bridge**

<table data-header-hidden><thead><tr><th width="219.833251953125"></th><th></th></tr></thead><tbody><tr><td>Select Bridge*</td><td><p>If applicable, select the bridge from the drop-down list.</p><p>The drop-down list displays all active bridges configured in OvalEdge. These bridges enable communication between data sources and OvalEdge without altering firewall rules.</p></td></tr></tbody></table>

2. After entering all connection details, the following actions can be performed:
   1. Click **Validate** to verify the connection.
   2. Click **Save** to store the connection for future use.
   3. Click **Save & Configure** to apply additional settings before saving.
3. The saved connection will appear on the **Connectors home page**.

## Manage Connector Operations

### Crawl/Profile

{% hint style="warning" %}
To perform crawl and profile operations, users must be assigned the Integration Admin role.
{% endhint %}

The **Crawl/Profile** button allows users to select one or more schemas for crawling and profiling.&#x20;

1. Navigate to the Connectors page and click **Crawl/Profile**.
2. Select the schemas you want to crawl.
3. The **Crawl** option is selected by default. Click the **Crawl & Profile** radio button to run both operations.
4. Click **Run** to collect metadata from the connected source and load it into the **OvalEdge Data Catalog.**
5. After a successful crawl, the information appears in the **Data Catalog > Databases tab.**

The Schedule checkbox allows automated crawling and profiling at defined intervals, from a minute to a year.

1. Click the **Schedule** checkbox to enable the Select Period drop-down.
2. Select a time period for the operation from the drop-down menu.
3. Click **Schedule** to initiate metadata collection from the connected source.
4. The system will automatically execute the selected operation (**Crawl** or **Crawl & Profile**) at the scheduled time.

#### Other Operations

The **Connectors page** in OvalEdge provides a centralized view of all configured connectors, including their health status.

**Managing connectors includes:**

* **Connectors Health:** Displays the current status of each connector using a green icon for active connections and a red icon for inactive connections, helping to monitor the connectivity with data sources.
* **Viewing**: Click the **Eye** icon next to the connector name to view connector details, including databases, tables, columns, and codes.

**Nine Dots Menu Options:**

To view, edit, validate, build lineage, configure, or delete connectors, click on the **Nine Dots** menu.

* **Edit Connector**: Update and revalidate the data source.
* **Validate Connector**: Check the connection's integrity.
* **Settings**: Modify connector settings.
  * **Crawler**: Configure data extraction.
  * **Profiler**: Customize data profiling rules and methods.
  * **Query Policies:** Define query execution rules based on roles.
  * **Access Instructions**: Add notes on how data can be accessed.
  * **Business Glossary Settings**: Manage term associations at the connector level.
  * **Anomaly Detection Settings:** Configure anomaly detection preferences at the connector level.
  * **Connection Pooling**: Allows configuring parameters such as maximum pool size, idle time, and timeouts directly within the application.
  * **Others**: Configure notification recipients for metadata changes.
* **Build Lineage**: Automatically build data lineage using source code parsing.
* **Delete Connector**: Remove a connector with confirmation.

## Connectivity Troubleshooting

If incorrect parameters are entered, error messages may appear. Ensure all inputs are accurate to resolve these issues. If issues persist, contact the assigned support team.

<table><thead><tr><th width="86.3333740234375">S.No.</th><th width="163.6666259765625">Error Message(s)</th><th>Error Description &#x26; Resolution</th></tr></thead><tbody><tr><td><br>1</td><td>Login failed for user</td><td><p>Error Description: This error occurs due to incorrect database credentials or an invalid authentication configuration while connecting to the DB2 database.</p><p>Resolution: Verify the following to resolve the issue:</p><ul><li>Ensure the username and password are correct and case-sensitive.</li><li>Confirm the database name (SID) is correct and exists.</li><li>Verify the user account has CONNECT privilege on the target database.</li><li>Check that the user account is not locked or expired.</li><li>Test the credentials using DB2 Command Line Processor or IBM Data Studio.</li><li>Validate the connection string format:</li><li>jdbc:db2://{server}:{port}/{sid}</li></ul></td></tr><tr><td><br>2</td><td>The TCP/IP connection to the host has failed</td><td><p>Error Description: This error indicates a network connectivity issue while attempting to connect to the DB2 database server.</p><p>Resolution: Verify the following to resolve the issue:</p><ul><li>Ensure the hostname or IP address is correct and reachable.</li><li>Confirm the port number (default 50005) is correct and open in the firewall.</li><li>Verify the DB2 server is running and accessible.</li><li>Ensure the DB2 instance is started using the db2start command.</li><li>Test connectivity using telnet &#x3C;server> &#x3C;port> or ping.</li><li>Validate the connection string format:</li><li>jdbc:db2://{server}:{port}/{sid}</li></ul></td></tr><tr><td><br>3</td><td>Invalid number format for port number</td><td><p>Error Description: This error occurs when an invalid or incorrectly formatted port number is provided for the DB2 connection.</p><p>Resolution</p><ul><li>Ensure the port number is numeric and within the valid range (1–65535).</li><li>Remove any special characters or spaces from the port field.</li><li>Use the default DB2 port 50005 unless a custom port is configured.</li><li>Verify the configured port in DB2 using the command: db2 get dbm cfg.</li></ul></td></tr></tbody></table>

## FAQs

<details>

<summary>Connection validation fails with "Failed to load driver class com.ibm.db2.jcc.DB2Driver". What does this mean?</summary>

This indicates that the DB2 JDBC driver is not available in the classpath. Verify the following:

* Driver com.ibm.db2.jcc.DB2Driver is present in the classpath.
* DB2 JDBC driver JAR (db2jcc.jar or db2jcc4.jar) is placed in the external JAR directory (ovaledge.jarpath).
* Restart the application after placing the JAR file.
* Verify the driver version compatibility with the DB2 server version.

</details>

<details>

<summary>What's the difference between Database (SID) and how should I configure it?</summary>

In DB2, Database (SID) refers to the target database name. Ensure the following:

* Connection string format: jdbc:db2://{server}:{port}/{sid}
* Database exists and is accessible (list db directory).
* User has CONNECT privilege on the database.
* Database is in the correct state (ACTIVE, not RESTRICTED).

</details>

<details>

<summary>My connection string keeps showing errors. Why?</summary>

Ensure the connection string uses the correct placeholders and format:

* Format: jdbc:db2://{server}:{port}/{sid}
* Replace placeholders with actual values (no curly braces in the final string).
* Ensure there are no spaces in the connection string.
* Verify the server name resolves correctly.

</details>

<details>

<summary>I'm getting a "Cannot open database" error. How do I fix this?</summary>

This occurs when the database name is incorrect or inaccessible. Verify the following:

* Database (SID) exists and is online (db2 list db directory).
* User has CONNECT permission on the database.
* Database state is ACTIVE (not RESTRICTED or QUIESCE).
* User is mapped to the correct database.

</details>

<details>

<summary>getRemoteDatabases() returns empty list or fails. What should I check?</summary>

Check user permissions and schema filtering:

* User has SELECT privilege on SYSCAT.SCHEMATA.
* System schemas are excluded by default (DEFINERTYPE='U' and OWNERTYPE='U').
* To include system schemas, set Catalog SYS Schemas attribute to true.
* Verify the connection and database name.

Query used:\
SELECT SCHEMANAME FROM SYSCAT.SCHEMATA WHERE DEFINERTYPE='U' AND OWNERTYPE='U'

</details>

<details>

<summary>I'm getting an "Invalid object name" error when fetching tables. How do I resolve this?</summary>

This occurs when the table or schema does not exist or is inaccessible. Verify the following:

* Schema name exists in SYSCAT.SCHEMATA.
* Table name is correct (case-sensitive in DB2).
* User has SELECT privilege on SYSCAT.TABLES.
* Schema name matches exactly (trimmed in code).
* Query uses a parameterized WHERE clause: tabschema = ?

</details>

<details>

<summary>getRemoteTables() returns tables but TYPE field shows incorrect values.</summary>

The TYPE field from SYSCAT.TABLES determines the table type:

* 'V' = VIEW (mapped to TableType.VIEW)
* Other values = TABLE (mapped to TableType.TABLE)
* REMARKS field provides the table description or comment.
* Verify TYPE values in SYSCAT.TABLES match expectations.

</details>

<details>

<summary>getRemoteColumns() returns empty or fails. What should I check?</summary>

Verify permissions and object names:

* User has SELECT privilege on SYSCAT.COLUMNS.
* Table and schema names are correct (case-sensitive).
* Proper escaping is used for special characters in identifiers.
* Query uses parameterized WHERE clause: tabschema = ? AND tabname = ?
* NULLS field ('Y' / 'N') determines nullable status.

</details>

<details>

<summary>executeQuery() returns empty results or times out. How to troubleshoot?</summary>

Check the following:

* Query correctness and DB2 syntax compliance.
* Network stability and connection health.
* jdbcTemplate.setMaxRows(limit) is set correctly.
* User has required SELECT privileges.
* Review execution logs for SQL errors.
* Verify table and schema names are correct.

</details>

<details>

<summary>getRemoteProcedureAndFunctionCode() fails with "Could not find stored procedure".</summary>

Verify the following:

* Procedure or function exists in SYSCAT.ROUTINES.
* User has SELECT privilege on SYSCAT.ROUTINES.
* ROUTINESCHEMA matches the provided schema name.
* TEXT IS NOT NULL filter is applied (only routines with definitions).
* ROUTINETYPE values:
  * 'P' = PROCEDURE
  * 'F' = FUNCTION

</details>

<details>

<summary>Stored procedure execution returns incorrect parameter types.</summary>

Verify DB2 to JDBC type mappings:

* SMALLINT → SMALLINT
* INTEGER → INTEGER
* BIGINT → BIGINT
* VARCHAR → VARCHAR
* CHAR → CHAR
* CLOB → CLOB
* DATE → DATE
* TIME → TIME
* TIMESTAMP → TIMESTAMP
* DECIMAL → DECIMAL
* DOUBLE → DOUBLE

Ensure the types match the SYSCAT.ROUTINEPARMS definition exactly.

</details>

<details>

<summary>getSqlProfileResults() fails with "Skip datatype profile validation". What does this mean?</summary>

This indicates unsupported column types for profiling:

* XML data type is skipped (present in SkipDataTypeForProfile list).
* Columns with length < 0 or > MAX\_COLUMN\_PROFILE\_LENGTH\_LIMIT are skipped.
* This is expected behavior and requires no action.

</details>

***

Copyright © 2025, OvalEdge LLC, Peachtree Corners, GA, USA.
