RetoolをClickHouseに接続する
1. 接続詳細を収集する
To connect to ClickHouse with HTTP(S) you need this information:
-
The HOST and PORT: typically, the port is 8443 when using TLS or 8123 when not using TLS.
-
The DATABASE NAME: out of the box, there is a database named
default
, use the name of the database that you want to connect to. -
The USERNAME and PASSWORD: out of the box, the username is
default
. Use the username appropriate for your use case.
The details for your ClickHouse Cloud service are available in the ClickHouse Cloud console. Select the service that you will connect to and click Connect:

Choose HTTPS, and the details are available in an example curl
command.

If you are using self-managed ClickHouse, the connection details are set by your ClickHouse administrator.
ClickHouseにHTTP(S)で接続するには、次の情報が必要です:
-
HOSTとPORT: 通常、ポートはTLSを使用する場合は8443、TLSを使用しない場合は8123です。
-
DATABASE NAME: デフォルトでは、
default
という名前のデータベースがあります。接続したいデータベースの名前を使用してください。 -
USERNAMEとPASSWORD: デフォルトでは、ユーザー名は
default
です。ご利用のケースに適したユーザー名を使用してください。
ClickHouse Cloudサービスの詳細はClickHouse Cloudコンソールで確認できます。接続するサービスを選択し、Connectをクリックします:

HTTPSを選択すると、詳細が例のcurl
コマンドで提供されます。

セルフマネージドのClickHouseを使用している場合、接続の詳細はClickHouseの管理者によって設定されます。
2. ClickHouseリソースを作成する
Retoolアカウントにログインし、Resources タブに移動します。「新規作成」 -> 「リソース」を選択します:

利用可能なコネクタのリストから「JDBC」を選択します:

セットアップウィザードで、「ドライバー名」として com.clickhouse.jdbc.ClickHouseDriver
を選択してください:

次の形式でClickHouseの認証情報を入力します: jdbc:clickhouse://HOST:PORT/DATABASE?user=USERNAME&password=PASSWORD
。
インスタンスがSSLを要求する場合、またはClickHouse Cloudを使用している場合は、接続文字列に &ssl=true
を追加します。この場合、次のようになります: jdbc:clickhouse://HOST:PORT/DATABASE?user=USERNAME&password=PASSWORD&ssl=true

その後、接続をテストします:

これで、ClickHouseリソースを使用してアプリに進むことができるはずです。