IBM Db2 connection
To access your data in an IBM Db2 database, create a connection asset for it.
IBM Db2 is a database that contains relational data.
Supported versions
IBM Db2 10.1 and later
Create a connection to Db2
To create the connection asset, you need these connection details:
- Username and password
- SSL certificate (if required by your database server)
- For SSL, the Db2 connection does not support chained certificates. Only the certificate returned from the Db2 server, which is the first certificate, will work.
- To configure Db2 with TLS and SSL, see Setting up a Db2 connection that uses TLS and SSL.
Credentials
If you select Shared, enter your username and password for the server.
If you select Personal, you have one of three choices:
- Enter your username and password for the server manually.
- Use secrets from a vault.
- Select platform login credentials. This option is available only if the Db2 service is deployed on the instance of Cloud Pak for Data where you are creating the connection.
For Credentials and Certificates, you can use secrets if a vault is configured for the platform and the service supports vaults. For information, see Using secrets from vaults in connections.
Choose the method for creating a connection based on where you are in the platform
In a project Click Add to project > Connection. See Adding a connection to a project.
In a catalog
Click Add to catalog > Connection. See Adding a connection asset to a catalog.
In a deployment space
Click Add to space > Connection. See Adding connections to a deployment space.
In the Platform assets catalog
Click New connection. See Adding platform connections.
Next step: Add data assets from the connection
Where you can use this connection
You can use Db2 connections in the following workspaces and tools:
Analytics projects
- AutoAI (Watson Machine Learning)
- Cognos Dashboards (Watson Studio
- Data Refinery (Watson Studio or Watson Knowledge Catalog)
- DataStage (DataStage service). The Db2 (optimized) connection for DataStage gives you increased performance and more features such as before and after SQL statements, sparse lookup, and rejects links. However, you cannot use the "(optimized)" connection with other tools.
- Decision Optimization (Watson Studio and Watson Machine Learning)
- Metadata import (Watson Knowledge Catalog)
- Notebooks (Watson Studio). Use the insert-to-code function to get the connection credentials and load the data into a data structure. See Load data from data source connections.
- SPSS Modeler (SPSS Modeler service)
Catalogs
- Platform assets catalog
- Other catalogs (Watson Knowledge Catalog)
Data Virtualization service You can connect to this data source from Data Virtualization.
Running SQL statements
To ensure that your SQL statements run correctly, refer to the IBM Db2 product documentation for the correct syntax.
Cloud Pak for Data credentials setup (Optional)
To use Cloud Pak for Data credentials, you must set up JWT token authentication on the Db2 server. For instructions, see Token configuration file.
Learn more
Parent topic: Supported connections