Connecting to your Db2 database

You can connect command-line interfaces, IBM® or third-party applications and tools, or apps that you create to your database.

Prerequisites

Before attempting to connect to your Db2 database, verify that you have the following necessary prerequisites:
  • Collect database details and credentials

    To connect to your database, you need database details (such as the host name), as well as credentials (such as a user ID and password).

  • Verify that a supported driver is installed
    • If your application or tool already contains the Db2 v11.1 IBM Data Server Driver Package, then your application or tool is able to connect to your Db2 database by using that driver.
    • Otherwise, install the Db2 driver package.

  • Configure your environment
    • Add entries to the driver configuration file, db2dsdriver.cfg, for your database.
    • Secure Sockets Layer (SSL)

      You can choose to connect with or without SSL. Connection details, such as which port to use and the connection string, depend on whether or not you use SSL connections.

      To use SSL connections, you need a CA certificate:
      • If you use the latest Db2 driver package, the certificate file is bundled with the package and will be used for connections.

  • Confirm ports are available

    If your network is behind a firewall, confirm that communications are permitted on port number 50000 for standard protocols or port number 50001 for SSL connections.

Collecting connection information
Database details and connection credentials
Downloading and installing driver package
Configuring your environment

Connecting programmatically

You can use common programming languages to create applications that connect to your database.

Integrating apps and tools

You can also connect external applications and tools to Db2 Warehouse on Cloud and use them to further manage or analyze your data. For example:
Data integration
Data visualization / BI
Data science

Connecting to another Db2 database

Db2 data virtualization (also known as federation) is supported. Data virtualization gives you single-query access to all of your data that is on multiple distributed databases anywhere in your organization. You can access data that is on any of your Db2 or Informix® data sources, both in the cloud and on premises.

Data virtualization (federation)