# 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="/files/dby9dVAnqB9HiCcVBXLJ" alt=""><figcaption></figcaption></figure>

## Usage

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.uibakery.io/reference/data-sources/jdbc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
