Connecting to JDBC or ODBC data sources
Although Tableau Prep provides out-of-the-box connections to many popular data sources, there's always a chance you might be using another data source type. If this is the case, you can use JDBC and ODBC connections instead.
In order to use such connections, you must first install the requisite driver on the machine running Tableau Prep Builder and configure the connection outside of Tableau Prep. If you intend to publish your flow to Tableau Server, you must also create the same connection on the server itself, using the same DSN.
Important note
Tableau considers JDBC and ODBC unsupported connections and the success results may vary.
In this recipe, we'll walk through using an ODBC connection. The high-level steps for JDBC are largely the same.
Getting ready
In order to follow along with this recipe, you must have installed the appropriate driver for the connection type of your choice and configured the ODBC connection in your operating system.
How to do it…
To get started, ensure you have Tableau Prep Builder open, then follow these steps:
- From the home screen, click the Connect to Data button and scroll to the very bottom of the Connect pane to select Other Databases (ODBC):
- The connection dialog for ODBC connections is very simple as the connection details are already captured in the DSN you have pre-configured on your system. All you need to do is select the DSN of your choice, and enter your credentials prior to selecting Sign In.
- Once connected, the options on the flow screen will depend on your data source type. In this example, our ODBC connects to Microsoft SQL Server and shows the expected selection options, including Database, Schema, and Tables. Once you've added your desired table to the flow, you can treat this ODBC as any other connection type.
Important note
For ease of demonstration purposes, this recipe shows how to connect to Microsoft SQL Server using ODBC. However, when available, you should always aim to use a supported connection type in Tableau Prep rather than JDBC or ODBC. This ensures optimal performance and reduces the chance of unforeseen errors.
How it works…
Using JDBC and ODBC tells Tableau Prep to go to your system's respective data source connections, as referred to by the DSN name, and leverage the connection as configured. However, Tableau Prep cannot control these connections, its settings, or the drivers used. Therefore, they are not supported and should be used with caution.