Skip to content

watsonx.ai

Access Db2 from watsonx.ai

Based on where you are in the platform, choose the method for creating a connection to Db2 on IBM i.

The steps for these three different scenarios are quite similar. In this documentation, it will establish a connection within the project to illustrate the entire process.

Go to the project page, and click the Assets tab

image

Click New asset > Prepare data > Connect to a data source

image

Select the IBM Db2 for i connector

image

Enter the connection information

Typically, you need to provide information like the hostname, port number, username, and password. Below is port number information based on the JDBC driver and SSL/TLS configuration.
There are two JDBC driver options: IBM JCC driver and JT400 driver. The JT400 driver is preferred because it does not require an additional license like the JCC driver does.

JDBC DriverPort Non-SSLPort SSL
JCC driver446448
JT400 driver84719471
image image

If the certificate used in SSL/TLS configuration is not signed by a publicly trusted CA, then you need to paste the content of the CA certificate in the SSL certificate text box.

Verify the connection

Click Test connection to verify if the connection can be created successfully

Create the connection

Click Create. The connection appears on the Assets page. You can edit the connection by clicking the connection name on the Assets page.

Add data assets from the connection

A connected data asset is a pointer to data that is accessed through a connection to an external data source. You create a connected data asset by specifying a connection, any intermediate structures or paths, and a relational table or view, a set of partitioned data files, or a file. When you access a connected data asset, the data is dynamically retrieved from the data source. See Add data assets from the connection.

To add a data asset from a connection to a project:

  • From the project page, click the Assets tab, and then click Import assets > Connected data. image

  • Select an existing connection asset or create a new one as the source of the data. image

  • Select the data you want. You can select multiple connected data assets from the same connection. Click Import. image