# DB2 Add a DB2 Source Datastore

Source: https://userguide.qualytics.io/source-datastore/datastore/jdbc/db2/how-tos/add-source/

A source datastore is a storage location Qualytics connects to so it can profile, scan, and monitor data. Adding DB2 as a source lets Qualytics query your database through the DB2 JDBC driver and run quality operations on the tables it discovers.

Before you start, review the [Minimum DB2 Permissions](https://userguide.qualytics.io/source-datastore/datastore/jdbc/db2/permissions/#minimum-db2-permissions-source-datastore) the connecting user needs.

## Field reference

The **Add Datastore** page shows the sections below when DB2 is selected. When reusing an existing connection, the **Connection Properties** section, with its **Secrets Management** and **Advanced** groups, comes already filled in and read-only: Qualytics has already validated those credentials, so you fill in only the **Location** and the **General** fields. To change a saved connection's credentials, edit the connection through the [Manage Connections](https://userguide.qualytics.io/settings/connections/manage-connections/) page; edits there apply to every datastore that reuses the connection.

### Connection Properties

These fields define the DB2 server Qualytics connects to and the account it connects with, in the order the form shows them. They belong to the connection: when reusing an existing connection, they come already filled in and read-only.

| Field | Required | Type | Description |
| --- | --- | --- | --- |
| **Connection Name** | Yes | Text | A label for the saved connection (e.g., `acme_db2_warehouse`), so other datastores can reuse it later. |
| **HashiCorp Vault** | No | Toggle | Sits in the collapsed **Secrets Management** group, right below **Connection Name**. Turn it on to pull credentials from a secrets manager instead of typing them into the form; it shows the six fields below. Despite the label, any secrets manager that exposes a compatible REST API works, not only HashiCorp Vault; see [HashiCorp Vault](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/hashicorp-vault/). |
| **Login URL** | Yes | Text | Shown when **HashiCorp Vault** is on. The full URL of the login endpoint (e.g., `https://vault.example.com/v1/auth/approle/login`). With Vault namespaces, add the namespace after `/v1/`, as in `/v1/<namespace>/auth/approle/login`. |
| **Credentials Payload** | Yes | Text | Shown when **HashiCorp Vault** is on. A JSON body containing the credentials Vault expects (e.g., `{"role_id":"...","secret_id":"..."}`). |
| **Token JSONPath** | Yes | Text | Shown when **HashiCorp Vault** is on. The JSONPath that extracts the client token from Vault's response. Defaults to `$.auth.client_token`. |
| **Secret URL** | Yes | Text | Shown when **HashiCorp Vault** is on. The full URL of the secret, including `https://` and the host (e.g., `https://vault.example.com/v1/secret/data/db2`). With Vault namespaces, add the namespace after `/v1/`. |
| **Token Header Name** | Yes | Text | Shown when **HashiCorp Vault** is on. The HTTP header name used to send the token. Defaults to `X-Vault-Token`. |
| **Data JSONPath** | Yes | Text | Shown when **HashiCorp Vault** is on. The JSONPath that extracts the key/value pairs from Vault's response. Use `$.data.data` for a KV version 2 secret (its API path contains `/data/`) and `$.data` for KV version 1 or the database secrets engine. The form pre-fills `$.data`. |
| **Host** | Yes | Text | The hostname or address of the DB2 server. |
| **Port** | Yes | Number | The port the DB2 instance listens on. Defaults to `50000`. |
| **User** | Yes | Text | The DB2 user Qualytics connects as. See [Minimum DB2 Permissions](https://userguide.qualytics.io/source-datastore/datastore/jdbc/db2/permissions/#minimum-db2-permissions-source-datastore) for the privileges it needs. |
| **Password** | Yes | Text | The password for that user. |
| **SSL Connection** | No | Checkbox | Encrypts the connection between Qualytics and the DB2 server. Turn it on when your instance requires or supports TLS. |

> **Note**
>
> Once the secrets manager is configured, reference any secret value in the **Connection Properties** using `${key}` (e.g., `${db2_password}`). Qualytics resolves the secret at the moment the connection is opened, so changed keys take effect on the next connection. Write the reference with braces (`${key}`, never `$.key`) and match the key name's case. Setup steps, the namespace rule, and a troubleshooting page are on the [HashiCorp Vault](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/hashicorp-vault/) pages.

### Advanced

A collapsed group at the end of **Connection Properties**, below **SSL Connection**. It also belongs to the connection.

| Field | Required | Type | Description |
| --- | --- | --- | --- |
| **TLS Certificate Chain** | No | Text | The PEM-encoded signing chain for the DB2 server's certificate, for when its issuer is not one of the certificates Qualytics already trusts. Paste the server certificate and every intermediate, each as its own `-----BEGIN CERTIFICATE-----` block, up to 256 KiB in total. It applies to this connection only, and supplying it encrypts the connection on its own. |
| **Max Parallelization** | No | Number | Caps how many queries Qualytics runs at the same time against a datastore reached through this connection, from 1 to 100. Leave it empty for no explicit limit. The cap applies per datastore, so datastores sharing this connection each get their own allowance. See [Max Parallelization](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/connection/#max-parallelization). |

### Location

Pick the database and schema(s) Qualytics should read from. You fill these in on both flows.

| Field | Required | Type | Description |
| --- | --- | --- | --- |
| **Database** | Yes | Text | The database name (e.g., `DB2`). Typed in rather than picked from a list. |
| **Schema** | Yes | Option | One or more schemas inside that database (e.g., `DB2INST1`). Each schema you pick becomes its own Qualytics datastore. Click the refresh icon to load the available schemas. |

> **Note: Names are stored in upper case**
>
> Qualytics converts the **Database** and **Schema** names to upper case, matching how DB2 stores unquoted identifiers. Typing `mydb` and `myschema` records them as `MYDB` and `MYSCHEMA`. A value written as a Vault reference is left exactly as you typed it.

> **Note: Multiple schemas**
>
> Selecting more than one schema creates one source datastore per schema, named from the **Name Template**. See [Multiple-Schema Creation](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/multiple-schema/) for details.

### General

Common fields for every source datastore, shown below the **Location** section. You fill these in on both flows.

| Field | Required | Type | Description |
| --- | --- | --- | --- |
| **Name** | No | Text | The name of the new source datastore (e.g., `analytics_bronze`). Shown unless you select more than one schema; then **Name Template** replaces it. |
| **Name Template** | No | Text | Shown instead of **Name** when you select more than one schema. Defines the naming pattern for each source datastore being created. Use `{{schema}}` as a placeholder that gets replaced with the actual schema name (e.g., `db2_{{schema}}` becomes `db2_db2inst1`). Left empty, the datastore is named from the connection name and the schema. |
| **Group** | No | Option | Organizes your datastores under a shared group in the navigation tree. Select an existing group or create a new one with the **Add New Group** toggle. |
| **Teams** | Yes | Option | Select one or more teams to associate with this source datastore. |
| **Initiate Sync** | No | Checkbox | Automatically sync the datastore to detect containers and fields after creation. |

Below the form, an information banner lists the **Public addresses** and **Private addresses** your datastore connections originate from. Allow the ones that match your network setup through your security groups or firewall rules; see [Connection](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/connection/#finding-the-addresses-to-allow) for where the addresses come from.

## Steps

There are two ways to set up the connection: reuse a connection you already saved (**Existing Connection**) or create a new one from scratch (**New Connection**). The tabs below walk through each option; pick the one you want to follow. Each field is described in the [Field reference](https://userguide.qualytics.io/source-datastore/datastore/jdbc/db2/how-tos/add-source/#source-field-reference) above.

**Tab: New Connection**

**Step 1**: Navigate to the **Datastores** page.

**Step 2**: Click the **Add**  button at the top-right corner and choose **Source** .

**Step 3**: The **Add Datastore** page opens.

**Step 4**: Select **New Connection** next to the **Search**  field.

**Step 5**: Select **DB2** from the connector grid. Use the search field to filter connectors by name.

**Step 6**: Enter the **Connection Name**.

**Step 7**: Optionally, expand **Secrets Management** and turn on **HashiCorp Vault** to retrieve credentials from a secrets manager.

**Step 8**: Fill in the **Host**, **Port**, **User**, and **Password**, and turn on **SSL Connection** if your instance requires it.

**Step 9**: Optionally, expand **Advanced**. If the server's certificate is not one Qualytics already trusts, paste its signing chain into **TLS Certificate Chain**; you can also set **Max Parallelization** there.

**Step 10**: Fill in the **Location** fields (**Database** and **Schema**) and the **General** fields.

**Step 11**: Click **Test connection**. A success message confirms that the connection has been verified.

> **Info**
>
> The **Finish** and **Next** buttons stay disabled until the connection test passes on the current values. If you change a connection field after a successful test, test again. If the test fails, see [Troubleshooting](https://userguide.qualytics.io/source-datastore/datastore/jdbc/db2/troubleshooting/).

**Step 12**: Click **Finish** to create the datastore.

> **Tip**
>
> To link a destination so Qualytics can write anomalies and metadata from the first operation, click **Next** instead of **Finish**. See [Add Enrichment Datastore](https://userguide.qualytics.io/source-datastore/datastore/jdbc/db2/how-tos/add-enrichment/).

**Step 13**: A success dialog confirms that your datastore has been added. Click **Go to your datastore** to open its page.

**Tab: Existing Connection**

**Step 1**: Navigate to the **Datastores** page.

**Step 2**: Click the **Add**  button at the top-right corner and choose **Source** .

**Step 3**: The **Add Datastore** page opens.

**Step 4**: Select **Existing Connection** next to the **Search**  field.

**Step 5**: Select the saved DB2 connection from the grid. Use the search field to filter connections by name. The **Connection Properties** section and its groups come already filled in and read-only.

> **Tip: Start a new connection from this one**
>
> To use the selected connection as a starting point for a brand-new connection instead, click the **Duplicate as a new connection**  button on the selected connection. The form switches to **New Connection** mode with the connection's settings already filled in for you to adjust.

**Step 6**: Fill in the **Location** fields (**Database** and **Schema**) and the **General** fields. These are the only fields left to fill in: **Database**, **Schema**, and **Teams** are the required ones, while **Name** (or **Name Template**), **Group**, and **Initiate Sync** are optional.

**Step 7**: Click **Test connection**. A success message confirms that the connection has been verified.

> **Info**
>
> The **Finish** and **Next** buttons stay disabled until the connection test passes on the current values. If the test fails, see [Troubleshooting](https://userguide.qualytics.io/source-datastore/datastore/jdbc/db2/troubleshooting/).

**Step 8**: Click **Finish** to create the datastore.

> **Tip**
>
> To link a destination so Qualytics can write anomalies and metadata from the first operation, click **Next** instead of **Finish**. See [Add Enrichment Datastore](https://userguide.qualytics.io/source-datastore/datastore/jdbc/db2/how-tos/add-enrichment/).

**Step 9**: A success dialog confirms that your datastore has been added. Click **Go to your datastore** to open its page.

*Last updated: November 16, 2026.*
