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

# ODBC/JDBC Connections

> Connect to Datazone using Clickhouse ODBC or JDBC drivers

# ODBC/JDBC Connections

Datazone uses Clickhouse as its SQL interface, allowing you to connect to your data using standard Clickhouse ODBC and JDBC drivers.

## ODBC Connection

### System Requirements

* Windows, Linux, or macOS
* Clickhouse ODBC Driver installed
* Network access to Datazone instance

### Installing Clickhouse ODBC Driver

#### Windows

1. Download the Clickhouse ODBC driver from the official website
2. Run the installer
3. Configure the ODBC data source in Windows ODBC Data Source Administrator

#### Linux

```bash theme={null}
# Ubuntu/Debian
apt-get install clickhouse-odbc

# CentOS/RHEL
yum install clickhouse-odbc
```

#### macOS

```bash theme={null}
brew install clickhouse-odbc
```

### Connection String

```
Driver={Clickhouse ODBC Driver};Server=app.datazone.co;Port=8123;Database=default;UID=your_username;PWD=your_password;Protocol=http;
```

### Configuration Parameters

| Parameter | Required | Description                             |
| --------- | -------- | --------------------------------------- |
| Server    | Yes      | Your Datazone instance hostname         |
| Port      | Yes      | Connection port (default: 8123)         |
| Database  | Yes      | Target database name (default: default) |
| Protocol  | Yes      | Connection protocol (http/https)        |
| UID       | Yes      | Username                                |
| PWD       | Yes      | Password                                |

## JDBC Connection

### Requirements

* Java 8 or later
* Clickhouse JDBC driver
* Network access to Datazone instance

### Maven Dependency

```xml theme={null}
<dependency>
    <groupId>com.clickhouse</groupId>
    <artifactId>clickhouse-jdbc</artifactId>
    <version>0.3.2</version>
</dependency>
```

### Connection URL

```
jdbc:clickhouse://app.datazone.co:8123/default
```

### Java Example

```java theme={null}
String url = "jdbc:clickhouse://app.datazone.co:8123/default";
Properties props = new Properties();
props.setProperty("user", "your_username");
props.setProperty("password", "your_password");
Connection conn = DriverManager.getConnection(url, props);
```

## Common Use Cases

### BI Tool Integration

1. **Tableau**
   ```
   Connection Type: Other Databases (ODBC)
   Driver: Clickhouse ODBC Driver
   ```

2. **Power BI**
   ```
   Data Source: ODBC
   Driver: Clickhouse ODBC Driver
   ```

3. **Looker**
   ```
   Dialect: Clickhouse
   Connection: JDBC
   ```

### DBeaver Configuration

1. Create new connection
2. Select Clickhouse database
3. Enter connection details:
   ```
   JDBC URL: jdbc:clickhouse://app.datazone.co:8123/default
   Username: your_username
   Password: your_password
   ```

## Troubleshooting

### Common Issues and Solutions

1. **Connection Timeout**
   ```
   Error: Connection timeout
   Solutions:
   - Check network connectivity
   - Verify port is open (8123)
   - Check firewall rules
   ```

2. **Authentication Failed**
   ```
   Error: Authentication failed
   Solutions:
   - Verify credentials
   - Check user permissions
   - Ensure proper protocol (http/https)
   ```

3. **Query Performance**
   ```
   Issue: Slow queries
   Solutions:
   - Check query execution plan
   - Review data types
   - Use appropriate indexes
   ```

### Logging

Enable detailed logging in your connection string:

```
jdbc:clickhouse://app.datazone.co:8123/default?log_level=TRACE
```

## Next Steps

1. Install appropriate drivers for your system
2. Configure your connection using the provided parameters
3. Test the connection with a simple query
4. Integrate with your BI tools or applications
