JDBC, ODBC TUTORIAL

How to Create Tableau PostgreSQL Connection for Reporting

Updated: 10 Jan 2023

Introduction

Progress DataDirect’s PostgreSQL ODBC and JDBC Drivers offer a high-performing, secure, and reliable connectivity solution, for applications to access PostgreSQLdata. If you want to use our PostgreSQLDrivers with the Tableau Desktop application, Progress DataDirect has you covered. This tutorial will teach you how to configure the DataDirect PostgreSQLdrivers 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 ODBC drivers installed and a data source configured. If you have not yet done these steps, please follow these instructions:

  1. Download and install the Progress DataDirect PostgreSQL ODBC driver using the 15-day trial software. In this tutorial, we are connecting to Microsoft SQL Server.
  2. 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 PostgreSQL Data source in the following steps.

Configure Connection to PostgreSQL ODBC Driver Using the ODBC Administrator

  1. After the DataDirect PostgreSQL ODBC driver has been installed, open ODBC Administrator to configure the connection and click on Add.
    odbc data source administrator window with a list of user data sources and a focused add button
  2. Choose the “DataDirect X.X PostgreSQL Wire Protocol” and click on “Finish.”
    create new data source window; datadirect 8.0 PostgreSQL wire protocol selected from a list of drivers
  3. The ODBC PostgreSQL Wire Protocol Driver Setup window will pop up.
    odbc postgresql wire protocol driver setup window; general tab opened; empty description input field, host name field set to hostname, port number set to 5432, database name set to database and proxy mode set to 0 - none

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

  4. The PostgreSQL Logon screen will pop up. Provide logon credentials and click on “OK.”
    logon to postgresql wire protocol window; host name set to hostname, port number set to 5432, database name set to database, empty user name and password fields
  5. A dialog box will confirm that the connection is established.
    test connect dialog saying connection established

Connect to an ODBC Data Source

  1. Start Tableau and select the “Other Databases (ODBC)” option.
    tableau connect view; other databases (odbc) highlighted in the to a server section
  2. In the pop-up window, select the “DSN” radial button and choose the data source previously configured to connect to PostgreSQL in the dropdown.
    other databases (odbc) window, connect using subsection, dsn selected with postgre input
  3. Click on “Connect” and another Logon Dialog popup screen will appear. Enter your credentials and click on “OK.”
    logon to postgresql wire protocol window; host name set to hostname, port number to 5432, database name to database, empty username and password fields
  4. Select “Sign In” and the Tableau configuration screen should now appear.
    tableau config screen
  5. 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.
    edit custom sql window
  6. For example, you can execute a statement such as "Select * from schema_name.table_name" and then click on the "Sheet 1" option at the bottom of the Tableau screen.

    This screen will allow you to select data and create tables or charts, such as the sample below:

    bar chart in tableau

Prerequisites for JDBC

This tutorial assumes that you have JDBC drivers installed. If you have not it installed yet, please follow these instructions:  

 

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

 

Installing the JDBC driver

  1. Installing the driver:
    • If you are on Windows, extract the PROGRESS_DATADIRECT_JDBC_POSTGRESQL_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_POSTGRESQL_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 PostgreSQL .jar file.
    • On Windows, you will find it at C:\ProgramFiles\Progress\DataDirect\JDBC_60\lib\postgresql.jar
    • On Linux, you will find it at /home//Progress/DataDirect/JDBC_60/lib/ postgresql.jar

The Progress DataDirect PostgreSQL JDBC driver does not come with a Configuration Manager. This tutorial assumes that you have a JDBC connection URL built, to proceed to the further steps, i.e., connecting to Tableau Desktop.

 

Connecting Tableau to a JDBC Data Source

  1. To get started, copy postgresql.jar from the Progress installation location to Tableau’s driver location.
    • For Windows: copy postgresql.jar to C:\Program Files\Tableau\Drivers
    • For Mac: copy postgresql.jar to ~/Library/Tableau/Drivers
  2. Open Tableau and create a new data source.
    • Select “Other Databases (JDBC).”
      connect dialog; other databases (jdbc) selected in the to a server category
    • The pop-up window will appear.
      other databases (jdbc) window with empty URL field, dialect set to sql92, username set to user, a filled password field and an empty properties file input
  3. Please enter your PostgreSQL JDBC connection URL in the textbox. Enter credentials for username and password, and click on “Sign In.” For example: jdbc:datadirect:postgresql://MyServer:5432
    other databases (jdbc) window with filled URL with the connection string, dialect set to SQL92, username set to username, a filled password field and an empty properties file field

    Tableau will then connect to the PostgreSQL database, and the Configuration Screen will appear.

    tableau configuration screen showing the connection string
  4. 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.
    tableau schema view
  5. Once Tableau can access your relevant data, you can easily create reports like those shown below:
    tableau sample report

 

Conclusion

Get started today with a free 15-day trial of Progress DataDirect Snowflake ODBC drivers and JDBC drivers, and connect Tableau to all your data!    

Contact Us for assistance with any questions you may have, and we will be happy to help!  

Connect any application to any data source anywhere

Explore all DataDirect Connectors

Need additional help with your product?

Get Customer Support