Connecting Cognos to a Db2 database

You can run your Cognos® reports against data in the cloud rather than the data in an on-premises database. After you load your data to the Db2 database, you set up the JDBC driver, and then use the Cognos administration tools to create the database connection. These instructions explain how to connect to the database from Cognos version 10.2.1.

Procedure

To connect to the database from your Cognos server, you need the db2jcc.jar file. The db2jcc.jar file is part of the Db2 driver package, which you can download from the web console. The same file is available in the Windows or the Linux® download.

Important: If the Db2 driver package or the IBM® Data Server Driver Package is already installed on your computer, do not install it again.

  1. Download the Db2 driver package from the web console.
    • The Windows package is an executable file that installs multiple drivers on your computer.
    • The Linux package contains the db2jcc.jar file within compressed files. You can use the Linux package to access the db2jcc.jar file on a Windows computer too. You will need a decompress utility, such as 7-Zip.
  2. Locate the db2jcc.jar file:
    • Windows: After you run the ibm_data_server_driver_package_win64_v10.5.exe file, the db2jcc.jar file is installed in the C:\Program Files\IBM\IBM DATA SERVER DRIVER\java directory.
    • Linux: Decompress the ibm_data_server_driver_package_linuxx64_v10.5.tar.gz file, and then decompress the ibm_data_server_driver_package_linuxx64_v10.5.tar file. Go to the dsdriver\jdbc_sqlj_driver\linuxamd64 subdirectory. Decompress the db2_db2driver_for_jdbc_sqlj.zip file to access the db2jcc.jar file.
  3. Copy the db2jcc.jar file to the c10_location\webapps\p2pd\WEB-INF\lib directory on your Cognos Content Manager computer.

Follow these steps to connect the Cognos server to the Db2 database, BLUDB:

  1. Collect connect information and credentials.
  2. On your Cognos server, start IBM Cognos Administration. Use one of the following methods:
    • In the Welcome page, click Administer IBM Cognos Content.
    • In IBM Cognos Connection, from the toolbar, click Launch > IBM Cognos Administration.
    Cognos Administration landing page.
  3. From the Configuration tab, select Data Source Connections.
    Configuration tab, new data source.
  4. Click the new data source icon New data source icon.. The New Data Source wizard opens.
  5. In the "Specify a name and description" page, enter a unique name for the BLUDB data source and an optional description and screen tip. Click Next.
  6. In the "Specify the connection" page, select IBM DB2 for the type and specify the isolation level. Ensure that Configure JDBC connection is selected, and then click Next.
    Specify the connection New Data Source wizard.
  7. In the "Specify the IBM DB2 connection string" page, use the following parameters:
    1. Enter BLUDB in the DB2 database name field.
      Specify the IBM DB2 connection string DB2 database name New Data Source wizard.
    2. Ensure that the Signons radio button is selected, and then select the two check boxes for Password and Create a signon that the Everyone group can use. Use the user ID and password that you obtained in step 4. Click Finish.
      Specify the IBM DB2 connection string, New Data Source wizard.
  8. On the "Specify the IBM DB2 (JDBC) connection string" page, specify the server name and port number that you obtained in step 4. The database name is BLUDB.
    Specify the IBM DB2 (JDBC) connection string New Data Source wizard.
  9. Click Test the connection, then click Test. On the "View the results" page, the status of the connection tests for the dynamic query mode should be Succeed. Click Finish.

Results

Your Cognos server is now connected to the Db2 database. Use your Cognos tools to create dynamic cubes and start generating reports. Following are resources from the Cognos documentation: