> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/database-devops/setup-db-devops/jdbc-connection-string/set-up-db2-connector.md).

# Set Up IBM DB2 connector

IBM DB2 is a family of data management products that includes three variants, each running on different platforms and requiring different JDBC drivers and connection formats.

Harness DB DevOps supports all three IBM DB2 variants with Liquibase Community for database change management.

### DB2 variants supported <a href="#db2-variants-supported" id="db2-variants-supported"></a>

Harness DB DevOps supports the following IBM DB2 variants:

* **DB2 LUW**: DB2 for Linux, Unix, and Windows
* **DB2 for i**: DB2 for iSeries (AS/400)
* **DB2 z/OS**: DB2 for IBM Mainframe (requires customer-provided IBM license JAR)

### Prerequisites for IBM DB2 <a href="#prerequisites-for-ibm-db2" id="prerequisites-for-ibm-db2"></a>

#### 1. DB2 LUW <a href="#id-1-db2-luw" id="id-1-db2-luw"></a>

Ensure the following prerequisites are met for DB2 LUW connections.

* **JDBC Driver**: IBM JCC driver (`jcc.jar`) is included in Harness DB DevOps
* **Authentication**: Username and password
* **Database Permissions**: The database user must have schema modification permissions including `CREATE`, `ALTER`, `DROP` for tables and indexes, and `SELECT`, `INSERT`, `UPDATE`, `DELETE` on the target schema. For Liquibase change tracking, the user must be able to create and modify the `DATABASECHANGELOG` and `DATABASECHANGELOGLOCK` tables.
* **Network Access**: Delegate must have connectivity to the DB2 instance on port 50000 (default)
* **SSL**: Supported via `sslConnection=true` parameter. Go to [Configure SSL for database connections](/database-devops/use-db-devops/database-authentication-and-security/ssl.md) to set up SSL.

#### 2. DB2 for i (iSeries/AS/400) <a href="#id-2-db2-for-i-iseriesas400" id="id-2-db2-for-i-iseriesas400"></a>

Ensure the following prerequisites are met for DB2 for i connections.

* **JDBC Driver**: IBM Toolbox for Java (JT400) is included in Harness DB DevOps
* **Authentication**: Username and password
* **Database Permissions**: The database user must have authority to create, alter, and drop objects in the target library. For Liquibase change tracking, the user must be able to create and modify the `DATABASECHANGELOG` and `DATABASECHANGELOGLOCK` tables within the library.
* **Network Access**: Delegate must have connectivity to the IBM i system
* **Library**: IBM i uses libraries instead of databases. Specify the library name in the connection URL.

#### 3. DB2 z/OS <a href="#id-3-db2-zos" id="id-3-db2-zos"></a>

Ensure the following prerequisites are met for DB2 z/OS connections.

* **JDBC Driver**: IBM JCC driver (`jcc.jar`) is included in Harness DB DevOps
* **License Requirement**: Customer must provide IBM DB2 Connect license JAR (`db2jcc_license_cisuz.jar`)
* **Authentication**: Username and password
* **Database Permissions**: The database user must have privileges to create, alter, and drop tables, indexes, and tablespaces in the target database. For Liquibase change tracking, the user must be able to create and modify the `DATABASECHANGELOG` and `DATABASECHANGELOGLOCK` tables. Consult your DBA for appropriate DB2 z/OS authorization grants.
* **Network Access**: Delegate must have connectivity to the DB2 z/OS instance on port 446 (default)
* **SSL**: Supported via `sslConnection=true` parameter. Go to [Configure SSL for database connections](/database-devops/use-db-devops/database-authentication-and-security/ssl.md) to set up SSL.
* **Location Name**: DB2 z/OS uses location names (must be uppercase). Obtain via `SELECT CURRENT SERVER FROM SYSIBM.SYSDUMMY1`.

{% hint style="info" %}
**NOTE**

The `translate binary=true` and `date format=iso` parameters are required for Liquibase to work correctly with DB2 for i. Go to [Why are these parameters required?](#why-are-the-translate-binary-and-date-format-parameters-required-for-db2-for-i) for details.
{% endhint %}

{% hint style="warning" %}
**DB2 Z/OS LICENSE REQUIREMENT**

DB2 z/OS requires a customer-provided IBM DB2 Connect license JAR (`db2jcc_license_cisuz.jar`). Contact your IBM representative to obtain this license file. Without this license, connections to DB2 z/OS will fail. Go to [Provide the DB2 z/OS license JAR](#provide-the-db2-zos-license-jar) for setup instructions.
{% endhint %}

{% hint style="info" %}
**NOTE**

**DB2 for i library vs. database:** IBM i uses libraries as the schema container, not traditional databases. Specify the library name in the JDBC URL path. For example, `jdbc:as400://myhost/MYLIB` connects to library `MYLIB`.
{% endhint %}

### Provide the DB2 z/OS license JAR <a href="#provide-the-db2-zos-license-jar" id="provide-the-db2-zos-license-jar"></a>

DB2 z/OS connections require the IBM DB2 Connect license JAR (`db2jcc_license_cisuz.jar`). This license is not included with Harness DB DevOps and must be obtained from IBM and provided to Harness.

#### Obtain the license JAR <a href="#obtain-the-license-jar" id="obtain-the-license-jar"></a>

Contact your IBM representative or IBM support to obtain `db2jcc_license_cisuz.jar`. This license is typically included with IBM DB2 Connect products.

#### Prepare the license file <a href="#prepare-the-license-file" id="prepare-the-license-file"></a>

The license JAR must be base64-encoded before it can be mounted into the Harness pipeline execution environment.

On the delegate host or any Linux system, run the following command:

```bash
base64 -w 0 db2jcc_license_cisuz.jar > db2jcc_license_cisuz.b64
```

This creates a base64-encoded text file (`db2jcc_license_cisuz.b64`) that can be safely mounted via `CI_MOUNT_VOLUMES`.

{% hint style="info" %}
**NOTE**

**macOS users:** Use `base64 -b 0` instead of `base64 -w 0` on macOS systems.
{% endhint %}

#### Place the encoded file on the delegate <a href="#place-the-encoded-file-on-the-delegate" id="place-the-encoded-file-on-the-delegate"></a>

Copy the `.b64` file to a location on the delegate filesystem where the Harness Delegate can access it. For example:

```bash
/opt/harness-delegate/db2-license/db2jcc_license_cisuz.b64
```

Ensure the delegate process has read permissions on this file.

#### Configure CI\_MOUNT\_VOLUMES <a href="#configure-cimountvolumes" id="configure-cimountvolumes"></a>

In your Harness pipeline, configure the `CI_MOUNT_VOLUMES` environment variable to mount the base64-encoded license file into the pipeline step container.

Set the environment variable in your pipeline step:

```yaml
CI_MOUNT_VOLUMES=/opt/harness-delegate/db2-license/db2jcc_license_cisuz.b64:/etc/license/dbops/db2jcc_license_cisuz.b64
```

**Format:** `<source-path-on-delegate>:<destination-path-in-container>`

The destination path must be `/etc/license/dbops/db2jcc_license_cisuz.b64` for Harness DB DevOps to detect and use the license automatically.

{% hint style="info" %}
**NOTE**

The Harness DB DevOps pipeline automatically decodes the base64-encoded license file and places it in the correct location for Liquibase to use during DB2 z/OS operations.
{% endhint %}

### Verify the connection <a href="#verify-the-connection" id="verify-the-connection"></a>

After configuring your DB2 connector, use the test connection feature in Harness to verify that the delegate can reach the database.

*

![Verify DB2 for i connection](/files/otMcvSMJjUb1Pkevk515) \*

![Verify DB2 connection](/files/gNFdVCw4ndNb4FP5TVfP)

A successful connection confirms the JDBC URL, credentials, and network access are correctly configured. For DB2 z/OS, a successful test also confirms the license JAR is correctly provisioned.

### FAQs <a href="#faqs" id="faqs"></a>

#### Which IBM DB2 variant should I use? <a href="#which-ibm-db2-variant-should-i-use" id="which-ibm-db2-variant-should-i-use"></a>

The DB2 variant depends on your IBM platform:

* **DB2 LUW**: Use for DB2 running on Linux, Unix, or Windows servers
* **DB2 for i**: Use for DB2 on IBM i systems (iSeries, AS/400)
* **DB2 z/OS**: Use for DB2 on IBM mainframe systems

If you are unsure, check with your database administrator. The JDBC URL format differs for each variant.

#### How do I obtain the DB2 z/OS license JAR? <a href="#how-do-i-obtain-the-db2-zos-license-jar" id="how-do-i-obtain-the-db2-zos-license-jar"></a>

The IBM DB2 Connect license JAR (`db2jcc_license_cisuz.jar`) is required for DB2 z/OS connections. This license is not included with Harness DB DevOps and must be obtained from IBM.

Contact your IBM representative or IBM support to acquire the license file. The license is typically included with IBM DB2 Connect products.

#### What is the difference between database and library in DB2 for i? <a href="#what-is-the-difference-between-database-and-library-in-db2-for-i" id="what-is-the-difference-between-database-and-library-in-db2-for-i"></a>

IBM i uses the term **library** instead of database or schema. A library is a container for database objects such as tables, views, and procedures.

When connecting to DB2 for i, specify the library name in the JDBC URL. For example:

```bash
jdbc:as400://myhost/MYLIB
```

This connects to the `MYLIB` library on the IBM i system.

#### Why are the translate binary and date format parameters required for DB2 for i? <a href="#why-are-the-translate-binary-and-date-format-parameters-required-for-db2-for-i" id="why-are-the-translate-binary-and-date-format-parameters-required-for-db2-for-i"></a>

The `translate binary=true` and `date format=iso` parameters are required for Liquibase to work correctly with DB2 for i:

* `translate binary=true`: Forces EBCDIC to Unicode character conversion for CCSID 65535 fields. Without this, Liquibase change tracking tables may have character encoding issues.
* `date format=iso`: Ensures dates are formatted as YYYY-MM-DD, which Liquibase expects for timestamp handling.

These parameters prevent data corruption and compatibility issues when Liquibase creates and manages its internal change tracking tables.

#### Can I connect to DB2 z/OS without the license JAR? <a href="#can-i-connect-to-db2-zos-without-the-license-jar" id="can-i-connect-to-db2-zos-without-the-license-jar"></a>

No. The IBM DB2 Connect license JAR is mandatory for DB2 z/OS connections. Without it, the JDBC driver cannot establish a connection to DB2 z/OS instances. This is an IBM licensing requirement, not a Harness limitation.

#### What permissions does the database user need? <a href="#what-permissions-does-the-database-user-need" id="what-permissions-does-the-database-user-need"></a>

The database user needs the following permissions:

**For schema changes (migrations):**

* `CREATE TABLE`, `ALTER TABLE`, `DROP TABLE`
* `CREATE INDEX`, `DROP INDEX`
* `SELECT`, `INSERT`, `UPDATE`, `DELETE` on all tables in the target schema

**For Liquibase change tracking:**

* Ability to create and modify `DATABASECHANGELOG` and `DATABASECHANGELOGLOCK` tables

**DB2 z/OS specific:**

* Consult your DBA for appropriate authorization grants, as mainframe security models may require additional privileges.

For read-only operations like policy validation, read permissions on the target schema are sufficient.

### Next steps <a href="#next-steps" id="next-steps"></a>

* Go to [Setting up JDBC connectors](/database-devops/setup-db-devops/jdbc-connection-string/set-up-connectors.md) to configure connectors for other supported databases.
* Go to [Secure database connectivity with SSL](/database-devops/use-db-devops/database-authentication-and-security/ssl.md) to enable encrypted connections for DB2 LUW and DB2 z/OS.
* Go to [Get started with changelogs](/database-devops/setup-db-devops/get-started-with-changelogs.md) to begin authoring Liquibase changesets for your DB2 schema.
