# Configuring Db2 for LUW workspace data connections

During workspace creation, under **Connection Type**, click **Db2 for LUW**.

## Connecting to the source database <a href="#db2-luw-workspace-source" id="db2-luw-workspace-source"></a>

In the **Source Settings** section, you provide the connection information for the source database.

### **Providing the connection details** <a href="#db2-luw-workspace-source-connection" id="db2-luw-workspace-source-connection"></a>

To provide the connection details for the source database:

1. In the **Server** field, provide the server where the database is located.
2. In the **Database** field, provide the name of the database.
3. In the **Port** field, provide the port to use to connect to the database.
4. In the **Username** field, provide the username for the account to use to connect to the database.
5. For **Password**, you can either specify the password manually or, if secrets managers are available, you can [select a secret name from a secrets manager](/app/workspace/workspace-configuration-settings/secrets-manager/selecting-a-secrets-manager-secret.md).
6. To test the connection to the source data, click **Test Source Connection**.

### Connection security settings <a href="#source-connection-security" id="source-connection-security"></a>

For the source connection, you can also:

* [Use SSL/TLS to encrypt authentication.](/app/workspace/workspace-configuration-settings/data-connection-settings/ensuring-encryption-of-database-authentication.md)
* [Trust the server certificate.](/app/workspace/workspace-configuration-settings/data-connection-settings/trusting-the-server-certificate.md)
* [Use a connection tunneling option (SSH only).](/app/workspace/workspace-configuration-settings/data-connection-settings/using-a-connection-tunneling-option.md)

## Connecting to the destination database <a href="#db2-luw-workspace-destination" id="db2-luw-workspace-destination"></a>

Note that you must create the destination database with the full schema before you run data generation.

### **Copying the connection and authentication details from the source database** <a href="#db2-luw-workspace-destination-copy" id="db2-luw-workspace-destination-copy"></a>

If the destination database is in the same location as the source database, then you can copy the connection and authentication details from the source database.

To copy the connection and authentication details from the source database:

1. Click **Copy Settings from Source**.
2. For **Password**, you can either specify the password manually or, if secrets managers are available, you can [select a secret name from a secrets manager](/app/workspace/workspace-configuration-settings/secrets-manager/selecting-a-secrets-manager-secret.md).
3. To test the connection to the destination database, click **Test Destination Connection**.

### **Providing the connection details** <a href="#db2-luw-workspace-destination-connection" id="db2-luw-workspace-destination-connection"></a>

To provide the connection details for the destination database:

1. In the **Server** field, provide the server where the database is located.
2. In the **Database** field, provide the name of the database.
3. In the **Port** field, provide the port to use to connect to the database.
4. In the **Username** field, provide the username for the account to use to connect to the database.
5. For **Password**, you can either specify the password manually or, if secrets managers are available, you can [select a secret name from a secrets manager](/app/workspace/workspace-configuration-settings/secrets-manager/selecting-a-secrets-manager-secret.md).
6. To test the connection to the destination database, click **Test Destination Connection**.

### Connection security settings <a href="#destination-connection-security" id="destination-connection-security"></a>

For the destination connection, you can also:

* [Use SSL/TLS to encrypt authentication.](/app/workspace/workspace-configuration-settings/data-connection-settings/ensuring-encryption-of-database-authentication.md)
* [Trust the server certificate.](/app/workspace/workspace-configuration-settings/data-connection-settings/trusting-the-server-certificate.md)
* [Use a connection tunneling option (SSH only).](/app/workspace/workspace-configuration-settings/data-connection-settings/using-a-connection-tunneling-option.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tonic.ai/app/setting-up-your-database/db2-luw/db2-luw-workspace-data-connections.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
