Skip to content
Connect to Managed ClickHouse® with the JDBC driver

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®.

VariableDescription
CLICKHOUSE_HTTPS_HOSTHTTPS service host of your ClickHouse service.
CLICKHOUSE_HTTPS_PORTHTTPS service port of your ClickHouse service.
CLICKHOUSE_USERUsername to access ClickHouse service.
CLICKHOUSE_PASSWORDPassword 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=STRICT

You’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