Configuring your Db2 connection with basic authentication

How to use your Db2® credentials to establish a connection to Db2.

Before you begin

zosConnect-3.0 Applies to zosConnect-3.0.

Containers Applies to z/OS Connect container deployments.

The following task must be completed.

  1. Creating the Db2 tutorial workspace.

About this task

You provide your user ID and password, and z/OS Connect Designer passes your credentials to Db2 for authentication.
Figure 1. Passing only user credentials to Db2
Architecture image showing z/OS Connect Designer passing only user credentials to Db2

Procedure

Creating the db2.xml file.
In your text editor, create a file with the following content.
<?xml version="1.0" encoding="UTF-8" ?>
<server description="Db2 connection">
    <featureManager>
        <feature>zosconnect:db2-1.0</feature>
    </featureManager>
    <zosconnect_credential user="${DB2_USERNAME}" password="${DB2_PASSWORD}" id="commonCredentials"/>
    <zosconnect_db2Connection id="db2Conn" host="${DB2_HOST}" port="${DB2_PORT}" credentialRef="commonCredentials"/> 
</server>

Save the file as db2.xml in the directory ZCWorkspace/EmployeesApi/src/main/liberty/config.

Verify that the new files and directories are listed correctly. The following screen image shows the resulting project structure.

/ZCWorkspace
|-- /certs
|-- /logs
|-- /EmployeesApi/src/main/liberty/config/db2.xml
|-- docker-compose.yaml

What to do next

Start the z/OS Connect Designer and import an OpenAPI definition. See the task Starting the z/OS Connect Designer with Docker and importing an OpenAPI definition.