> ## Documentation Index
> Fetch the complete documentation index at: https://togai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# JDBC

Java Database Connectivity (JDBC) is an application programming interface which defines how a client may access a database. It provides methods to query and update data in a database, and is oriented toward relational databases.

The integration between **JDBC** and **Togai** requires only a one-time setup. Follow the steps below:

## Prerequisites

### Create a read-only user

* Create a read-only user in your database
* Grant the user access to the tables that you want to sync with Togai
* Make sure that the user has access to the tables that you want to sync with Togai

### Connection URI

#### Maria DB

The connection URI for Maria DB is as follows:

```bash theme={null}
jdbc:mariadb://<host>:<port>/<database_name>?user=<username>&password=<password>
```

#### MS SQL Server

The connection URI for MS SQL Server is as follows:

```bash theme={null}
jdbc:sqlserver://<host>:<port>;databaseName=<database_name>;user=<username>;password=<password>
```

#### MySQL DB

The connection URI for MySQL DB is as follows:

```bash theme={null}
jdbc:mysql://<host>:<port>/<database_name>?user=<username>&password=<password>
```

#### Oracle DB

The connection URI for Oracle DB is as follows:

```bash theme={null}
jdbc:oracle:thin:<username>/<password>@<host>:<port>:<database_name>
```

## Flows

### Sync customer from Database to Togai

* The flow will be available to be triggered on demand from the Togai dashboard
* It will execute a SQL query to fetch all the customers from Database
* It will then create the customers in Togai using the `Customers` API

### Sync events from Database to Togai

* The flow will be available to be triggered on demand from the Togai dashboard
* It will execute a SQL query to fetch all the events from Database
* It will then create the events in Togai using the `Event Ingestion` API
