JDBC, ODBC TUTORIAL

How to Build Tableau Reports on MySQL Data using the DataDirect MySQL Drivers

Updated: 04 Jan 2023

Introduction

Progress DataDirect’s MySQL ODBC and JDBC Drivers offer a high-performing, secure, and reliable connectivity solution, for ODBC and JDBC applications to access MySQL data. If you want to use our ODBC and JDBC MySQL Driver with the Tableau Desktop application, Progress DataDirect has you covered. This tutorial will teach you how to configure the DataDirect MySQL 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 MySQL 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 MySQL 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 MySQL ODBC driver has been installed, open ODBC Administrator to configure the connection and click on “Add”.        

 

                 

 

 

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

 

             A screenshot of a computer

Description automatically generated    

 

 

3. The ODBC MySQL Wire Protocol Driver Setup window will pop up.   

    

                                Graphical user interface

Description automatically generated   
    

 

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

 

 

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

 

                           Graphical user interface, application

Description automatically generated    

 

 

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, choose the data source previously configured to connect to MySQL in the dropdown, and click on “Connect.” 

Graphical user interface, application, email

Description automatically generated 

 

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

Graphical user interface, application

Description automatically generated 

 

 

4. The string extras will appear in the designated box. Enter any additional parameters required to connect to your MySQL 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 MySQL Database.

 

Installing the JDBC driver

1. After the driver has been downloaded:    

 

  • If you are on Windows, extract the PROGRESS_DATADIRECT_JDBC_MYSQL_WIN.zip and run the PROGRESS_DATADIRECT_JDBC_INSTALL.exeto install the JDBC driver.     
  • If you are on Linux, extract the PROGRESS_DATADIRECT_JDBC_MYSQL_WIN.zip and run the PROGRESS_DATADIRECT_JDBC_INSTALL.jarto start the installation.     

 

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

 

  • On Windows, you will find it at C:\Program Files\Progress\DataDirect\Connect_for_JDBC_51\lib\mysql.jar     
  • On Linux, you will find it at ~/home/<username>/Progress/DataDirect/ Connect_for_JDBC_51/lib/mysql.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 mysql.jar to C:\Program Files\Tableau\Drivers     
  • For Mac: copy mysql.jar to ~/Library/Tableau/Drivers    

 

2. Open Tableau and create a new data source.     

 

  • Select “Other Databases (JDBC).” 

 
 

  • The pop-up window will appear. 

 

 

 

  • 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:mysql://servername:port;DatabaseName=value; 

Building the Report in Tableau

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

 

 

 

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.      

 

 

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: