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

> Quickly build web and mobile apps with rich user interfaces, automate complex tasks, and integrate AI—all powered by your data.

# Connecting Retool to ClickHouse

export const PartnerBadge = () => {
  return <div className="PartnerBadge">
            <div className="PartnerBadgeIcon">
                <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <polyline points="12.5 9.5 10 12 6 11 2.5 8.5" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <polyline points="4.54 4.41 8 3.5 11.46 4.41" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <path d="M2.15,3.78 L0.55,6.95 A0.5,0.5 0,0,0 0.77,7.62 L2.5,8.5 L4.54,4.41 L2.82,3.55 A0.5,0.5 0,0,0 2.15,3.78 Z" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <path d="M13.5,8.5 L15.23,7.62 A0.5,0.5 0,0,0 15.45,6.95 L13.85,3.78 A0.5,0.5 0,0,0 13.18,3.55 L11.46,4.41 Z" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <path d="M11.5,4.5 L9,4.5 L6.15,7.27 A0.5,0.5 0,0,0 6.24,8.05 C7.33,8.74 8.81,8.72 10,7.5 L12.5,9.5 L13.5,8.5" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <polyline points="7.75 13.5 5.15 12.85 3.5 11.67" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                </svg>
            </div>
            Partner Integration
        </div>;
};

export const Image = ({img, alt, size = "lg"}) => {
  const normalizedSize = ["sm", "md", "lg"].includes(size) ? size : "lg";
  return <div className={`ch-image-${normalizedSize}`}>
      <Frame>
        <img src={img} alt={alt} />
      </Frame>
    </div>;
};

<PartnerBadge />

<Steps>
  <Step title="Gather your connection details" id="1-gather-your-connection-details">
    To connect to ClickHouse with HTTP(S) you need this information:

    | Parameter(s)              | Description                                                                                                    |
    | ------------------------- | -------------------------------------------------------------------------------------------------------------- |
    | `HOST` and `PORT`         | Typically, the port is 8443 when using TLS or 8123 when not using TLS.                                         |
    | `DATABASE NAME`           | Out of the box, there is a database named `default`, use the name of the database that you want to connect to. |
    | `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 a service and click **Connect**:

    <div className="ch-image-md">
      <Frame>
        <img src="https://mintcdn.com/private-7c7dfe99/EDr8ydtGBgFPOQea/images/_snippets/cloud-connect-button.webp?fit=max&auto=format&n=EDr8ydtGBgFPOQea&q=85&s=97d6a020a443f1b365b017488b39d0c8" alt="ClickHouse Cloud service connect button" width="998" height="932" data-path="images/_snippets/cloud-connect-button.webp" />
      </Frame>
    </div>

    Choose **HTTPS**. Connection details are displayed in an example `curl` command.

    <div className="ch-image-md">
      <Frame>
        <img src="https://mintcdn.com/private-7c7dfe99/EDr8ydtGBgFPOQea/images/_snippets/connection-details-https.webp?fit=max&auto=format&n=EDr8ydtGBgFPOQea&q=85&s=80369fc90cd1ac3108fe455f2426c19a" alt="ClickHouse Cloud HTTPS connection details" width="1320" height="1184" data-path="images/_snippets/connection-details-https.webp" />
      </Frame>
    </div>

    If you're using self-managed ClickHouse, the connection details are set by your ClickHouse administrator.
  </Step>

  <Step title="Create a ClickHouse resource" id="2-create-a-clickhouse-resource">
    Login to your Retool account and navigate to the *Resources* tab. Choose "Create New" -> "Resource":

    <Image img="https://mintcdn.com/private-7c7dfe99/6s0zAeps_NYZmK2e/images/integrations/tools/data-integration/retool/retool_01.webp?fit=max&auto=format&n=6s0zAeps_NYZmK2e&q=85&s=ed34ddfe4447cad699a936e3a36c93c0" size="lg" border alt="Creating a new resource" width="1843" height="908" data-path="images/integrations/tools/data-integration/retool/retool_01.webp" />

    <br />

    Select "JDBC" from the list of available connectors:

    <Image img="https://mintcdn.com/private-7c7dfe99/6s0zAeps_NYZmK2e/images/integrations/tools/data-integration/retool/retool_02.webp?fit=max&auto=format&n=6s0zAeps_NYZmK2e&q=85&s=6097acbba8929453d7331456edcea140" size="lg" border alt="Choosing JDBC connector" width="1478" height="490" data-path="images/integrations/tools/data-integration/retool/retool_02.webp" />

    <br />

    In the setup wizard, make sure you select `com.clickhouse.jdbc.ClickHouseDriver` as the "Driver name":

    <Image img="https://mintcdn.com/private-7c7dfe99/6s0zAeps_NYZmK2e/images/integrations/tools/data-integration/retool/retool_03.webp?fit=max&auto=format&n=6s0zAeps_NYZmK2e&q=85&s=2337f7bac3d54563a89056b2178c268c" size="lg" border alt="Selecting the right driver" width="1475" height="1011" data-path="images/integrations/tools/data-integration/retool/retool_03.webp" />

    <br />

    Fill in your ClickHouse credentials in the following format: `jdbc:clickhouse://HOST:PORT/DATABASE?user=USERNAME&password=PASSWORD`.
    If your instance requires SSL or you're using ClickHouse Cloud, add `&ssl=true` to the connection string, so it looks like `jdbc:clickhouse://HOST:PORT/DATABASE?user=USERNAME&password=PASSWORD&ssl=true`

    <Image img="https://mintcdn.com/private-7c7dfe99/6s0zAeps_NYZmK2e/images/integrations/tools/data-integration/retool/retool_04.webp?fit=max&auto=format&n=6s0zAeps_NYZmK2e&q=85&s=152fd831d32a0c47bbaf8a2432cb4e54" size="lg" border alt="Specifying your credentials" width="1475" height="923" data-path="images/integrations/tools/data-integration/retool/retool_04.webp" />

    <br />

    After that, test your connection:

    <Image img="https://mintcdn.com/private-7c7dfe99/6s0zAeps_NYZmK2e/images/integrations/tools/data-integration/retool/retool_05.webp?fit=max&auto=format&n=6s0zAeps_NYZmK2e&q=85&s=7be77a552d567b407c135fd4ee869dcf" size="lg" border alt="Testing your connection" width="1475" height="1008" data-path="images/integrations/tools/data-integration/retool/retool_05.webp" />

    <br />

    Now, you should be able to proceed to your app using your ClickHouse resource.
  </Step>
</Steps>
