Skip to main content

TDengine ODBC

Introduction

The TDengine ODBC driver is a driver specifically designed for TDengine based on the ODBC standard. It can be used by ODBC based applications,like PowerBI, on Windows, to access a local or remote TDengine cluster or a TDengine Cloud instance. The minimum TDengine version is 3.2.2.0.

TDengine ODBC provides two kinds of connections, native connection and WebSocket connection. You can choose to use either one for your convenience. WebSocket is the recommended choice and you must use WebSocket if you are trying to access an instance in the TDengine Cloud service.

Note: TDengine ODBC driver can only be run on 64-bit systems, and can only be invoked by 64-bit applications.

Install

  1. The TDengine ODBC driver only supports the Windows platform. To run on Windows, the Microsoft Visual C++ Runtime library is required. If the Microsoft Visual C++ Runtime Library is missing on your platform, you can download and install it from VC Runtime Library.

  2. Install TDengine Client package for Windows. The TDengine Client version should be above 3.2.1.0. The client package includes both the TDengine ODBC driver and some other necessary libraries that will be used in either native connection or WebSocket connection.

Configure Data Source

  1. Click the "Start" Menu, and Search for "ODBC", and choose "ODBC Data Source (64-bit)" (Note: Don't choose 32-bit)

  2. Select "User DSN" tab, and click "Add" to enter the page for "Create Data Source"

  3. Choose the data source to be added, here we choose "TDengine"

  4. Click "Finish", and enter the configuration page for "TDengine ODBC Data Source", fill in required fields

    ODBC websocket connection config

    4.1 [DSN]: Data Source Name, required field, to name the new ODBC data source

    4.2 [Connection Type]: required field, we choose "WebSocket"

    4.3 [URL]: required field, the URL for the ODBC data source, https://gw.cloud.taosdata.com?token=your_token is the URL for an instance in the TDengine Cloud service.

    4.4 [Database]: optional field, the default database to access

  5. Click "Test Connection" to test whether the connection to the data source is successful; if successful, it will prompt "Successfully connected to URL"

  6. Click "OK" to set the configuration and exit.

PowerBI

As an example, you can use PowerBI, which invokes TDengine ODBC driver, to access TDengine, please refer to Power BI for more details.