# JDBC

JDBC stands for *Java Database Connectivity* - it's a standard Java protocol for connecting to databases. \
UI Bakery allows you to connect to data sources that don't have native support on the platform but have a JDBC driver.

{% hint style="danger" %}
The **Cloud** **self-service** plans of UI Bakery currently only support the following data sources: Exasol, Presto, and SAP Hana. Connecting to other data sources is available on the **On-premise** or **Cloud Enterprise** plans.
{% endhint %}

## Configuration

### Configuring your Enterprise instance to support a custom JDBC driver

In order for a custom JDBC driver to work, it needs to be available in the `datasource` container. The easiest way to do this is to copy the driver to a VM where your datasource container is running and mount it to the container using the `docker-compose.yml` file:

```docker
  datasource:
    container_name: datasource
    image: cruibakeryonprem.azurecr.io/cloud/datasource:latest
    restart: always
    env_file: .env
    volumes:
      - ~/jdbc-driver-location-host:~/jdbc-driver-location-container
```

After that, you need to add the following environment variable to your `.env` file and restart the instance:

```bash
UI_BAKERY_DATASOURCE_JDBC_DRIVER_PATH=~/jdbc-driver-location-container/driver.jar
```

{% hint style="success" %}
You can also add several drivers, if necessary, separating them by commas.
{% endhint %}

### Connecting the JDBC datasource

1. On the **Data sources** page, click **Connect**, and select *JDBC* in the Data sources list.
2. Specify the JDBC connection string, for example:

```
jdbc:<driver type>:<host>:<port>
```

{% hint style="info" %}
You can also supply different connection properties the driver supports using query parameters.
{% endhint %}

3. Next, specify *Driver name*, your *username* & *password* and test the connection.
4. Click **Connect Datasource** to complete the setup.

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FhvF8sg3p3qWfR36prqKZ%2FCleanShot%202025-04-18%20at%2016.33.03%402x-min.png?alt=media&#x26;token=c241e5f5-bc67-4b3e-ae75-df9d9a8122db" alt=""><figcaption></figcaption></figure>

## Usage

Currently, UI Bakery only supports the [SQL Query](https://docs.uibakery.io/reference/working-with-actions/sql-query) action step when working with JDBC data sources.
