Connect to Managed ClickHouse® with the JDBC driver
You can use the ClickHouse JDBC driver to connect a JDBC client, an application or a BI tool to your Managed ClickHouse database over HTTPS.
You will need Managed ClickHouse® service, accessible by HTTPS. Read the HTTPS host and port
from the clickhouse_https entry of the service components:
exo x get-dbaas-service-clickhouse my-clickhouse -z ch-gva-2 \
-q "components[?component=='clickhouse_https']"Note
To reach an external database from your service instead, see Run federated queries in Managed ClickHouse®.
| Variable | Description |
|---|---|
CLICKHOUSE_HTTPS_HOST | HTTPS service host of your ClickHouse service. |
CLICKHOUSE_HTTPS_PORT | HTTPS service port of your ClickHouse service. |
CLICKHOUSE_USER | Username to access ClickHouse service. |
CLICKHOUSE_PASSWORD | Password to access ClickHouse service. |
Connection string
Replace CLICKHOUSE_HTTPS_HOST and CLICKHOUSE_HTTPS_PORT with your
connection values:
jdbc:ch://CLICKHOUSE_HTTPS_HOST:CLICKHOUSE_HTTPS_PORT?ssl=true&sslmode=STRICTYou’ll also need to provide user name and password to establish the connection. For example, if you use Java:
Connection connection = dataSource.getConnection("CLICKHOUSE_USER", "CLICKHOUSE_PASSWORD");Last updated on