# IBM DB2 (AS/400)

This article outlines the integration with the IBM DB2 (AS/400) 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://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/pM0Ag4fps3HGopf06f5v/unknown.png" 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.2.4</td></tr><tr><td>Releases Supported (Available from)</td><td>Release6.3.4</td></tr><tr><td><p>Connectivity</p><p>[How the connection is established with the IBM DB2 (AS/400)]</p></td><td>JDBC driver</td></tr><tr><td>Verified IBM DB2 (AS/400) Version</td><td>11.5.x</td></tr></tbody></table>

{% hint style="info" %}
The IBM DB2 (AS/400) connector has been validated with the mentioned "Verified IBM DB2 (AS/400) Versions" and is expected to be compatible with other supported IBM DB2 (AS/400) 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 (AS/400) and mapped to the corresponding UI assets.

<table><thead><tr><th width="213.88885498046875">DB2 (AS/400) Object</th><th width="151.6666259765625">DB2 (AS/400) Attribute</th><th width="173.3333740234375">OvalEdge Attribute</th><th width="158.2220458984375">OvalEdge Category</th><th>OvalEdge Type</th></tr></thead><tbody><tr><td>Table</td><td>Table Name</td><td>Table Name</td><td>Tables</td><td>oetable</td></tr><tr><td>Table</td><td>Table Data Type</td><td>Table Type</td><td>Tables</td><td>oetable</td></tr><tr><td>Table</td><td>Table Comments</td><td>Table Description</td><td>Tables</td><td>oetable</td></tr><tr><td>Column</td><td>Column Name</td><td>Column Name</td><td>Table Columns</td><td>oecolumn</td></tr><tr><td>Column</td><td>Data Type</td><td>Data Type</td><td>Table Columns</td><td>oecolumn</td></tr><tr><td>Column</td><td>Length</td><td>Length</td><td>Table Columns</td><td>oecolumn</td></tr><tr><td>Column</td><td>Ordinal Position</td><td>Column Position</td><td>Table Columns</td><td>oecolumn</td></tr><tr><td>Column</td><td>Column Comments</td><td>Column Description</td><td>Table Columns</td><td>oecolumn</td></tr><tr><td>Column</td><td>Is Nullable</td><td>Nullable</td><td>Table Columns</td><td>oecolumn</td></tr><tr><td>Schema</td><td>Schema Name</td><td>Schema Name</td><td>Schemas</td><td>oeschema</td></tr><tr><td>View</td><td>View Name</td><td>Query Name</td><td>Queries</td><td>oequery</td></tr><tr><td>View</td><td>View Definition</td><td>Query Code</td><td>Queries</td><td>oequery</td></tr><tr><td>Procedure</td><td>Routine Name</td><td>Query Name</td><td>Queries</td><td>oequery</td></tr><tr><td>Procedure</td><td>Routine Type</td><td>Query Type</td><td>Queries</td><td>oequery</td></tr><tr><td>Procedure</td><td>Routine Definition</td><td>Query Code</td><td>Queries</td><td>oequery</td></tr><tr><td>Procedure</td><td>Long Comment</td><td>Query Description</td><td>Queries</td><td>oequery</td></tr><tr><td>Function</td><td>Routine Name</td><td>Query Name</td><td>Queries</td><td>oequery</td></tr><tr><td>Function</td><td>Routine Type</td><td>Query Type</td><td>Queries</td><td>oequery</td></tr><tr><td>Function</td><td>Routine Definition</td><td>Query Code</td><td>Queries</td><td>oequery</td></tr><tr><td>Function</td><td>Long Comment</td><td>Query Description</td><td>Queries</td><td>oequery</td></tr><tr><td>Trigger</td><td>Trigger Name</td><td>Query Name</td><td>Queries</td><td>oequery</td></tr><tr><td>Trigger</td><td>Action Statement</td><td>Query Code</td><td>Queries</td><td>oequery</td></tr><tr><td>Trigger</td><td>Long Comment</td><td>Query Description</td><td>Queries</td><td>oequery</td></tr><tr><td>Index</td><td>Index Name</td><td>Index Name</td><td>Indexes</td><td>-</td></tr><tr><td>Index</td><td>Table Name</td><td>Table Name</td><td>Indexes</td><td>-</td></tr><tr><td>Index</td><td>Column Name</td><td>Column Name</td><td>Indexes</td><td>-</td></tr><tr><td>Index</td><td>Uniqueness</td><td>Is Unique</td><td>Indexes</td><td>-</td></tr><tr><td>Foreign Key Relationship</td><td>Left Table</td><td>Source Table</td><td>Relationships</td><td>-</td></tr><tr><td>Foreign Key Relationship</td><td>Left Column</td><td>Source Column</td><td>Relationships</td><td>-</td></tr><tr><td>Foreign Key Relationship</td><td>Right Table</td><td>Target Table</td><td>Relationships</td><td>-</td></tr><tr><td>Foreign Key Relationship</td><td>Right Column</td><td>Target Column</td><td>Relationships</td><td>-</td></tr></tbody></table>

## 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 (AS/400) 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>jt400-21.0.6.jar</td><td>Use this file to enable DB2 (AS/400) 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 (AS/400) database.

{% hint style="warning" %}
The default port number for DB2 (AS/400) 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 (AS/400) 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 (AS/400) administrator, as users may not have the required access to assign them independently.
{% endhint %}

| Objects                      | System Tables     | Access Permission |
| ---------------------------- | ----------------- | ----------------- |
| Schema                       | QSYS2.SCHEMATA    | Select            |
| Tables                       | QSYS2.SYSTABLES   | Select            |
| Columns                      | QSYS2.SYSCOLUMNS  | Select            |
| Indexes                      | QSYS2.SYSINDEXES  | Select            |
| Foreign Keys / Relationships | QSYS2.SYSCSTCOL   | Select            |
| Views                        | QSYS2.SYSVIEWS    | Select            |
| Procedures / Functions       | QSYS2.SYSROUTINES | Select            |
| Triggers                     | QSYS2.SYSTRIGGERS | Select            |
| Schema Permissions           | SYSCAT.SCHEMATA   | Select            |
| Table Permissions            | SYSCAT.TABAUTH    | 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 (AS/400)**, 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, "DB2AS400" 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 the 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><table data-header-hidden><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>Auto Lineage</td><td>Supported</td></tr><tr><td>Data Quality</td><td>Supported</td></tr><tr><td>Data Access</td><td>Not Supported</td></tr></tbody></table><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 (AS/400) connection              </p><p>(Example: "DB2 (AS/400)_Prod").</p></td></tr><tr><td>Connector Environment</td><td>Select the environment (Example: PROD, STG) configured for the connector.</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 (AS/400) 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 (AS/400), "50005" is auto-populated. If required, the port number can be modified as per the custom port number that is configured for the DB2 (AS/400).</td></tr><tr><td>Database*</td><td>Enter the database name to which the service account user has access within the DB2 (AS/400).</td></tr><tr><td>Driver*</td><td>By default, the DB2 (AS/400) driver details are auto-populated. </td></tr><tr><td>Username*</td><td>Enter the service account username set up to access the DB2 (AS/400) 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 (AS/400) 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="76.77777099609375" align="right">Sl. No.</th><th width="142.11114501953125">Category</th><th width="198.22216796875">Error Message</th><th width="455.1112060546875">Error Description &#x26; Resolution</th></tr></thead><tbody><tr><td align="right">1</td><td>Connection &#x26; Authentication</td><td><strong>Access denied for user</strong></td><td><p><strong>Error Description:</strong> This error occurs when the provided DB2 AS400 credentials are incorrect, the user profile is disabled, or the user lacks required access privileges.</p><p><strong>Resolution:</strong></p><ul><li>Verify the username matches the DB2 AS400 user profile.</li><li>Confirm the password is correct, including case sensitivity and special characters.</li><li>Ensure the user profile exists and is not disabled in AS400.</li><li>Verify the user has permission to connect from the host/IP.</li><li>If using a credential manager, ensure credentials are stored and accessible.</li><li>Test the credentials using IBM i Access Client Solutions or another AS400 client.</li></ul></td></tr><tr><td align="right">2</td><td>Connection &#x26; Authentication</td><td><strong>Communications link failure / Connection refused</strong></td><td><p><strong>Error Description:</strong> This error occurs when the application cannot establish a network connection to the DB2 AS400 server.</p><p><strong>Resolution:</strong></p><ul><li>Verify the server hostname or IP address is correct and reachable.</li><li>Confirm the port number is correct (default 50005).• Ensure firewall rules allow inbound connections on the configured port.</li><li>Verify the DB2 AS400 server is running and accepting connections.</li><li>Test connectivity using <code>ping &#x3C;server></code> or <code>telnet &#x3C;server> &#x3C;port></code>.</li></ul></td></tr><tr><td align="right">3</td><td>Connection &#x26; Authentication</td><td><strong>Invalid number format for port number</strong></td><td><p><strong>Error Description:</strong> This error occurs when an invalid or incorrectly formatted port number is provided for the DB2 connection.</p><p><strong>Resolution:</strong></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></ul></td></tr><tr><td align="right">4</td><td>Connection &#x26; Authentication</td><td><strong>Unknown database</strong></td><td><p><strong>Error Description:</strong> This error occurs when the specified database or library name does not exist or is incorrectly specified in the connection settings.</p><p><strong>Resolution:</strong></p><ul><li>Verify the database/library name entered in the SID field is correct.</li><li>Ensure the library name matches an existing AS400 schema and is case-sensitive.</li><li>Confirm the connection string format is <code>jdbc:as400://{server}/{sid}</code>.</li><li>Validate library existence using <code>SELECT SCHEMA_NAME FROM QSYS2.SCHEMATA</code>.</li><li>Ensure the user has access privileges to the specified library.</li></ul></td></tr><tr><td align="right">5</td><td>Connection &#x26; Authentication</td><td><strong>Failed to retrieve DataSource from DataSourceProvider</strong></td><td><p><strong>Error Description:</strong> This error occurs when the system fails to initialize the data source or connection pool for the DB2 AS400 connection.</p><p><strong>Resolution:</strong></p><ul><li>Verify the connection string format is correct.</li><li>Ensure the AS400 JDBC driver is available in the application classpath.</li><li>Confirm network connectivity to the AS400 server.</li><li>Validate connection pool configuration settings.</li><li>Recreate the connector to clear cached connection pool state.</li></ul></td></tr><tr><td align="right">6</td><td>Column Access &#x26; Visibility</td><td><strong>Unsupported Data Type for Profile</strong></td><td><p><strong>Error Description:</strong> This error occurs when a column data type or length is not supported for profiling operations.</p><p><strong>Resolution:</strong></p><ul><li>Columns with length less than 0 or greater than <code>MAX_COLUMN_PROFILE_LENGTH_LIMIT</code> are skipped.</li><li>Verify the column data type and length before profiling.</li><li>Ensure SELECT privilege exists on the source table.</li></ul></td></tr><tr><td align="right">7</td><td>Data Profiling &#x26; Query Execution</td><td><strong>Could not profile table. No Data found</strong></td><td><p><strong>Error Description:</strong> This error occurs when the profiling query returns no rows or an unexpected result structure.</p><p><strong>Resolution:</strong></p><ul><li>Verify the table contains data using <code>SELECT COUNT(*) FROM &#x3C;library>.&#x3C;table></code>.</li><li>Check whether all column values are NULL.</li><li>Confirm the column data type is supported for profiling.</li><li>Ensure column length is within supported limits.</li></ul></td></tr></tbody></table>

## FAQs

<details>

<summary>What is the difference between database and schema in DB2 AS400?</summary>

In DB2 AS400, database and schema are synonymous and represent the same concept called a library. The connection format is `jdbc:as400://{server}/{sid}`, where the SID specifies the library/schema. Libraries organize tables, views, procedures, and other objects, and can be listed using `SELECT SCHEMA_NAME FROM QSYS2.SCHEMATA`.

</details>

<details>

<summary>I can't see any databases/schemas when trying to crawl. What's wrong?</summary>

I can see some databases but not all. Why are some missing?This is typically due to permission issues. The user must have SELECT privilege on `QSYS2.SCHEMATA`. Access can be verified using `SELECT SCHEMA_NAME FROM QSYS2.SCHEMATA`. Some system libraries may be filtered.

</details>

<details>

<summary>I can see some databases but not all. Why are some missing?</summary>

Only libraries that the connected user has access to are visible. Missing libraries may be system libraries or libraries without granted privileges. Verify accessible libraries using `SELECT SCHEMA_NAME FROM QSYS2.SCHEMATA` and confirm required permissions with the AS400 administrator.

</details>

<details>

<summary>I can see tables in one library but not another. What permissions are required?</summary>

To view tables in a library, SELECT privilege on `QSYS2.SYSTABLES` is required. Table visibility can be verified using `SELECT TABLE_NAME FROM QSYS2.SYSTABLES WHERE TABLE_SCHEMA = '<library_name>'`.

</details>

<details>

<summary>Some columns are missing from my table. Why?</summary>

Column metadata is retrieved from `QSYS2.SYSCOLUMNS`. All data types are supported for crawling, but some columns may be skipped during profiling if column length exceeds limits or is negative. Verify column metadata queries and connection settings.

</details>

<details>

<summary>Column nullable status is showing incorrectly. How is it determined?</summary>

The nullable status is derived from `IS_NULLABLE` in `QSYS2.SYSCOLUMNS`. DB2 AS400 returns `YES` or `NO`, which the system converts to nullable or not nullable. If parsing fails, it defaults to NOT NULL and logs a warning. Validation can be done using `SELECT COLUMN_NAME, IS_NULLABLE FROM QSYS2.SYSCOLUMNS`.

</details>

<details>

<summary>Indexes are not being fetched for my tables. What is required?</summary>

Index retrieval requires enabling the Indexes option in crawler settings and SELECT privilege on `QSYS2.SYSINDEXES` and `QSYS2.SYSINDEXCOLUMNS`. If queries fail, indexes are not attached to table metadata.

</details>

<details>

<summary>Foreign key relationships are not being retrieved. What permissions are needed?</summary>

Foreign key retrieval requires SELECT privilege on `QSYS2.SYSCSTCOL`. If the query fails, relationships will not be available. Access can be verified using `SELECT * FROM QSYS2.SYSCSTCOL`.

</details>

<details>

<summary>Row count is showing as 0 when the table has data. Why?</summary>

Row count is retrieved using `SELECT COUNT(*) FROM <library>.<table>`. If this query fails due to insufficient permissions, the system returns 0. Ensure SELECT privilege on the table and allow sufficient time for large tables.

</details>

<details>

<summary>I’m getting connection pool errors. What causes this?</summary>

Connection pool issues can occur due to excessive concurrent connections, connection leaks, network timeouts, or misconfigured pool size. The system uses HikariCP. Verify pool settings, monitor active connections, and restart the application if required.

</details>

<details>

<summary>How do I switch from database credentials to a credential manager?</summary>

Select the appropriate credential manager type, provide the secret name or path, and ensure the credential manager is accessible. The system retrieves credentials automatically. Test the connection after switching.

</details>

<details>

<summary>Connection string format is incorrect. How can it be fixed?</summary>

The correct format is `jdbc:as400://{server}/{sid}`. The system auto-generates the string based on Server and Database fields. The port is specified separately. Avoid manual edits unless necessary and verify formatting after changes.

</details>

***

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