How to Build Tableau Reports on IBM Db2 Data using the DataDirect Db2 Drivers

Introduction

Progress DataDirect’s IBM Db2 ODBC and JDBC Drivers offer a high-performing, secure, and reliable connectivity solution, for ODBC and JDBC applications to access Db2 data. If you want to use our ODBC and JDBC IBM Db2 Drivers with the Tableau Desktop application, Progress DataDirect has you covered. This tutorial will teach you how to configure the DataDirect Db2 ODBC and JDBC driver within Tableau Desktop to create reports. These steps can also configure any ODBC and JDBC connection with Tableau.

 

Prerequisites for ODBC

This tutorial assumes that you have the IBM Db2 ODBC driver installed, and a data source configured. If you have not yet done these steps, please follow these instructions.  

 

 

  • Configure a data source for your database. See the DataDirect documentation for assistance with setting up your data source. You will learn how to configure a Db2 Data source for both ODBC and JDBC in the following steps.   

 

Configure Connection to Db2 ODBC Driver Using the ODBC Administrator

1. After the DataDirect DB2 ODBC driver has been installed, open ODBC Administrator to configure the connection and click on “Add”.   

 

                   

 

 

2. Choose the “DataDirect X.X DB2 Wire Protocol” and click on “Finish.”   

 

 

               

 

 

3. The ODBC Db2 Wire Protocol Driver Setupwindow will pop up. 

 

                    
 

    

Enter your credentials, click Apply” and then Test Connect.”    

    

 

4. The Logon dialog will pop up. Provide logon credentials and click on “OK.”    

 

                   

    

 

5. A dialog box will confirm that the connection is established.    

 

         
 

Connect to an ODBC Datasource

1. Start Tableau and select the “Other Databases (ODBC)” option. 

 

 

 

 

2. In the pop-up window select the “DSN” radial button and choose the data source previously configured to connect to IBM Db2 in the dropdown and click on “Connect.” 

 

Graphical user interface, application, email

Description automatically generated 

 

3. The Logon Dialog will appear. Enter your password and click on “OK.” 

Graphical user interface

Description automatically generated 

 

4. The string extras will appear in the designated box. Enter any additional parameters required to connect to your Db2 data source, such as a username and password, and select “Sign In.”  

Graphical user interface, application, email

Description automatically generated 

 

Prerequisites for JDBC

Download and install the Progress DataDirect JDBC driver using the 15-day trial software. In this tutorial, we are connecting to Db2 Database.    

 

Installing the JDBC driver

1. After the driver has been downloaded:    

 

  • If you are on Windows, extract the PROGRESS_DATADIRECT_JDBC_DB2_WIN.zip and run the PROGRESS_DATADIRECT_JDBC_INSTALL.exe to install the JDBC driver.     
  • If you are on Linux, extract the PROGRESS_DATADIRECT_JDBC_DB2_WIN.zip and run the PROGRESS_DATADIRECT_JDBC_INSTALL.jar to start the installation.     

 

2. After you have completed the installation, you can find the Progress DataDirect Db2 jar file.    

 

  • On Windows, you will find it at C:\Program Files\Progress\DataDirect\Connect_for_JDBC_51\lib\db2.jar     
  • On Linux, you will find it at ~/home/<username>/Progress/DataDirect/ Connect_for_JDBC_51/lib/ db2.jar 

 

Connecting Tableau to a JDBC Datasource

1. To get started, copy db2.jar from the Progress installation location to Tableau’s driver location.    

   

  • For Windows: copy db2.jar to C:\Program Files\Tableau\Drivers     
  • For Mac: copy db2.jar to ~/Library/Tableau/Drivers    

 

2. Open Tableau and create a new data source.     

 

  • Select Other Databases (JDBC).” 

 
 

  • The pop-up window will appear. 

Graphical user interface, text, application, email

Description automatically generated 

 

  • Paste the JDBC connection string into the “URL” textbox. Enter credentials for username and password.     

 

The connection string will look something like this: 

 

jdbc:datadirect:db2://servername:port;DatabaseName=value; 

 

Building the Report in Tableau

1. Select “Sign In” and the Tableau configuration screen should now appear. 

 

Graphical user interface, text, application

Description automatically generated 

 

2. In the database dropdown menu choose the data source.   

 

3. You can use Tableau's schema and table drop-down list to browse and select your data, or you can execute SQL statements by clicking on the "New Custom SQL" option. 

 

 

 
 

  •  The image below shows the schemas on the left-hand side.    

Graphical user interface, text, application

Description automatically generated 

 

4. A popup dialogue box will appear to edit custom SQL. 

 

 

 
 

 

5. Once Tableau can access your relevant data, you can easily create reports like those shown below: