---
title: Core+ Flight SQL ODBC
sidebar_label: Flight SQL ODBC
---

The `Deephaven Enterprise Flight SQL ODBC Driver` enables ODBC-compliant applications such
as [PowerBI](https://powerbi.microsoft.com/), [Microsoft Excel](https://www.microsoft.com/en-us/microsoft-365/excel),
and [Tableau](https://www.tableau.com/) to connect to Deephaven Core+ servers. The driver is built
on [Flight SQL](https://arrow.apache.org/docs/format/FlightSql.html), a protocol on top
of [Arrow Flight](https://arrow.apache.org/docs/format/Flight.html) that exposes SQL-like capabilities. Deephaven Core+
workers provide a built-in Flight SQL server that makes tables in the global query scope available as named tables,
queryable through the default Flight SQL catalog using standard SQL.

> [!IMPORTANT]
> The `Deephaven Enterprise Flight SQL ODBC Driver` is currently available **for Windows only** (64-bit). Linux and
> macOS are not supported at this time.

> [!NOTE]
> Only `SELECT` queries are supported; `INSERT`, `UPDATE`, and `DELETE` queries are not currently supported.

While Flight SQL / ODBC may be a convenient starting point for BI tool integration, the Flight SQL APIs are
not [Live Dataframe APIs](/core/docs/conceptual/table-update-model/). If you need to receive real-time updates, use a
Deephaven-native client instead, such as the [Deephaven Core+ Python client](./python/coreplus-python-client.md) or
the [Deephaven Core+ Java client](./java/coreplus-java-client.md).

## Quick start

1. **Install the driver** — Run the MSI installer. The installer registers the driver automatically.
   See [Installation](#installation).
2. **Configure a DSN** — Open `odbcad32.exe`, create a new DSN, and fill in your connection details.
   See [Configure a DSN](#configure-a-dsn).
3. **Test your connection** — Click **Test Connection** in the DSN configuration dialog to verify connectivity.
   See [Create a DSN](#create-a-dsn) for details.
4. **Connect from an application** — Open PowerBI, Excel, or another ODBC-compliant tool and select your DSN.
   See [Application integration](#application-integration).

## Prerequisites

- **Operating system:** Windows 10 or Windows 11 (64-bit).
- **Administrator privileges** for installation.
- Access to a running Deephaven Core+ instance with Flight SQL enabled (Grizzly version 1.20240517.491 or later).
- The name of a running [Persistent Query (PQ)](../query-management/pq-overview.md) you want to connect to.

## Installation

### Download and run the MSI installer

1. Obtain `Deephaven-Enterprise-Flight-SQL-ODBC-<version>-win64.msi` from your Deephaven administrator or download
   location.

2. Double-click the MSI file. If prompted by **User Account Control (UAC)**, click **Yes** to allow the installation.

3. Follow the installation wizard:
   - Click **Next** on the welcome screen.

     ![Installation Welcome](../assets/user-guide/clients/flight-sql-odbc/installation-welcome.png)

   - Review and accept the Apache 2.0 license agreement.

     ![Installation License](../assets/user-guide/clients/flight-sql-odbc/installation-license.png)

   - Choose the installation directory (default: `C:\Program Files\Deephaven Enterprise Flight SQL ODBC\`).
   - Verify the program is signed by Deephaven when prompted by UAC.

     ![UAC Verify Publisher](../assets/user-guide/clients/flight-sql-odbc/installation-verify-publisher.png)

   - Click **Yes** to allow the installer to make changes to your system and complete the installation.

### Verify installation

1. Open **ODBC Data Source Administrator (64-bit)**:
   - Press `Win + R`, type `odbcad32.exe`, and press Enter; **or**
   - Search for "ODBC Data Sources (64-bit)" in the Start menu.
2. Go to the **Drivers** tab.
3. Confirm that **Deephaven Enterprise Flight SQL** appears in the list with version information and a file
   path.

> [!IMPORTANT]
> Always use the **64-bit** ODBC Administrator (`C:\Windows\System32\odbcad32.exe`). Do **not** use the 32-bit version (
> `C:\Windows\SysWOW64\odbcad32.exe`). The driver is 64-bit only.

## Configure a DSN

A Data Source Name (DSN) stores your connection settings so you don't have to enter them every time you connect from an
application. Windows supports two types of DSN:

- **User DSN** — Available only to the current Windows user. Recommended for personal workstations.
  - **System DSN** — Available to all users on the machine. Recommended for shared servers and service accounts.

### Create a DSN

1. Open **ODBC Data Source Administrator (64-bit)** (see [Verify installation](#verify-installation)).
2. Go to the **User DSN** tab or the **System DSN** tab, depending on the scope you need.
3. Click **Add...**, select **Deephaven Enterprise Flight SQL**, and click **Finish**.

4. Fill in the connection fields:

   ![DSN Configuration Window](../assets/user-guide/clients/flight-sql-odbc/configure-dsn.png)

   | Field                     | Required | Description                                                                                                                       |
   | ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
   | **Data Source Name**      | Yes      | A descriptive name (e.g., `Deephaven Production`). This is the name you select in applications like PowerBI.                      |
   | **Description**           | No       | Optional description (e.g., `Production analytics cluster`).                                                                      |
   | **Host Name**             | Yes      | Deephaven server hostname or IP address (e.g., `deephaven.mycompany.com`).                                                        |
   | **Port**                  | Yes      | Server port. Contact your Deephaven administrator for the correct value.                                                          |
   | **Persistent Query Name** | Yes      | Name of the [Persistent Query](../query-management/pq-overview.md) to connect to (e.g., `my_analytics_pq`).                       |
   | **Authentication Type**   | Yes      | **Basic Authentication** (username/password) or **Private Key Authentication** (key file). See [Authentication](#authentication). |

5. Click **Test Connection**. If successful, you'll see a **Test Connection Succeeded** dialog.
6. Click **OK** to save the DSN.

### Authentication

The driver supports two mutually exclusive authentication methods:

#### Basic Authentication

Enter your **User** and **Password** in the DSN dialog. Both fields are enabled when Basic Authentication is selected.

#### Private Key Authentication

When Private Key Authentication is selected, the **User** and **Password** fields are disabled. Instead, provide the *
_Private Key File Path_* — the full path to your Deephaven-format private key file (e.g.,
`C:\Users\yourusername\deephaven_key.txt`).
See [private key authentication](../sys-admin/security/authentication/private-key-login.md)
for more details on how private key authentication works in Deephaven. Your Deephaven administrator should provide you
with a private key file if your environment is configured to use this authentication method.

### Connection string format

To connect programmatically (without a pre-configured DSN), use an ODBC connection string:

**Basic Authentication:**

```text
Driver={Deephaven Enterprise Flight SQL};HOST=mycompany.com;PORT=<port>;UID=myUser;PWD=myPassword;PQName=myPQ;
```

**Private Key Authentication:**

```text
Driver={Deephaven Enterprise Flight SQL};HOST=deephaven.mycompany.com;PORT=<port>;PrivateKeyFilePath=C:\path\to\deephaven_key.txt;PQName=my_pq;
```

**Connection string parameters:**

| Parameter            | Required        | Default | Description                                                                     |
| -------------------- | --------------- | ------- | ------------------------------------------------------------------------------- |
| `HOST`               | Yes             | —       | Server hostname or IP address.                                                  |
| `PORT`               | Yes             | —       | Server port.                                                                    |
| `UID`                | Basic auth only | —       | Username.                                                                       |
| `PWD`                | Basic auth only | —       | Password.                                                                       |
| `PrivateKeyFilePath` | Key auth only   | —       | Path to Deephaven-format private key file. Mutually exclusive with `UID`/`PWD`. |
| `PQName`             | Yes             | —       | [Persistent Query](../query-management/pq-overview.md) name.                    |

## Application integration

### PowerBI Desktop

1. Open **PowerBI Desktop**.
2. Click **Home** → **Get Data** → **Other**.
3. Search for `ODBC`, select **ODBC**, and click **Connect**.

   ![PowerBI Get Data](../assets/user-guide/clients/flight-sql-odbc/powerbi-getdata.png)

4. Select your DSN from the **Data source name (DSN)** dropdown. Expand **Advanced options** and enter a SQL `SELECT`
   statement in the **SQL statement** input box to query a specific table on load.

   > [!NOTE]
   > Do **not** include a trailing semicolon (`;`) in the SQL statement.

   ![PowerBI From ODBC](../assets/user-guide/clients/flight-sql-odbc/powerbi-from-odbc.png)

5. Click **OK**. The query result is displayed directly in PowerBI.

   ![PowerBI Query Result](../assets/user-guide/clients/flight-sql-odbc/powerbi-query-result.png)

   _Example query result loaded from a Deephaven Core+ Persistent Query._

### Microsoft Excel

1. Open **Excel**.
2. Go to **Data** → **New Query** → **From Other Sources** → **From ODBC**.

   ![Excel Import Data](../assets/user-guide/clients/flight-sql-odbc/excel-import-data.png)

3. Select your DSN from the **Data source name (DSN)** dropdown. Expand **Advanced options** and enter a SQL `SELECT`
   statement in the **SQL statement** input box.

   > [!NOTE]
   > Do **not** include a trailing semicolon (`;`) in the SQL statement.

   ![Excel From ODBC](../assets/user-guide/clients/flight-sql-odbc/excel-from-odbc.png)

4. Click **OK**. The query result is displayed directly in Excel.

   ![Excel Query Result](../assets/user-guide/clients/flight-sql-odbc/excel-query-result.png)

   _Example query result loaded from a Deephaven Core+ Persistent Query._

### Python

Use the [`pyodbc`](https://pypi.org/project/pyodbc/) library to connect to Deephaven Core+ from Python on Windows.

> [!IMPORTANT]
> Always pass `autocommit=True` to `pyodbc.connect()`. The driver does not implement the `SQL_ATTR_AUTOCOMMIT`
> attribute, so omitting this parameter will cause a `HYC00 Optional feature not implemented` error.

#### Install pyodbc

```shell
pip install pyodbc
```

#### Connect using a DSN

    ```python
    import pyodbc

    conn = pyodbc.connect("DSN=Deephaven Production", autocommit=True)
    cursor = conn.cursor()

    cursor.execute("SELECT * FROM my_table")
    for row in cursor.fetchall():
        print(row)

    cursor.close()
    conn.close()
    ```

#### Connect using a connection string

**Basic Authentication:**

    ```python
    import pyodbc

    conn_str = (
        "Driver={Deephaven Enterprise Flight SQL};"
        "HOST=deephaven.mycompany.com;"
        "PORT=<port>;"
        "UID=myUser;"
        "PWD=myPassword;"
        "PQName=myPQ;"
    )

    conn = pyodbc.connect(conn_str, autocommit=True)
    ```

**Private Key Authentication:**

    ```python
    import pyodbc

    conn_str = (
        "Driver={Deephaven Enterprise Flight SQL};"
        "HOST=deephaven.mycompany.com;"
        "PORT=<port>;"
        "PrivateKeyFilePath=C:\\path\\to\\deephaven_key.txt;"
        "PQName=myPQ;"
    )

    conn = pyodbc.connect(conn_str, autocommit=True)
    ```

## Related documentation

- [Persistent Queries overview](../query-management/pq-overview.md)
