Db2 database details and connect credentials

To configure your local development environment and to connect applications and tools to your Db2 database, you need to know database details and connect credentials.

Database details

There are three important database details needed for connecting applications and tools to your database:
  • Host name - The host name of the server.

  • Port number - Used by the database manager for TCP/IP communication. (Note that your service is provisioned with one port number for connections that use Secure Socket Layer (SSL) and a different port for non-SSL connection.)

    If needed, you can get the IP address of your server by using the ping command or the nslookup command, specifying your host name.

  • Database name - The Db2 database.

Connect credentials

There are three types of credentials to be aware of:
  • IBMid - If you use IBM Cloud®, this is the ID you would use to log in to IBM Cloud. This is not what you use to connect applications or tools to your Db2 database.

  • Db2 database credentials - Your service comes provisioned with a database user ID and password that can be used to connect applications and tools to your database.

  • Administrator-created users - Db2 Warehouse and some Db2 managed service plans allow administrative users to create new users. These administrator-created user IDs and passwords can be used to log directly into the web console URL and to connect to the Db2 database from applications or tools.

Where to find database details and connect credentials

You can collect this information from four places:
  • Your administrator - If you are not the owner or administrator of your Db2 instance, you can get your database details and connect credentials from your administrator.

  • Db2 web console - Database details and credentials are available in the web console.

  • If you are using IBM Cloud:
    • Bluemix dashboard - When you view your service on your IBM Cloud dashboard, in the "Service credentials" area, you can view the database details as well as the database user ID and password.

    • VCAP_SERVICES - VCAP_SERVICES is an environment variable in IBM Cloud that contains database details and credentials in JSON format. When you view the service credentials for your service in your IBM Cloud dashboard, the contents of VCAP_SERVICES is what is displayed. When you bind other IBM Cloud services or apps to your service, those other services or apps can access database details and credentials programmatically by reading VCAP_SERVICES.