<?xml version="1.0" encoding="utf-8"?>

<!-- EngineVersion = Java version -->
<ApiConfig Name="ClickHouse"
           Slug="clickhouse-connector"
           Type="JDBC"
           Category="big-data"
           Id="1CA9DE26-206A-580C-A2A4-1195CDE47C6D"
           Version="1"
           EngineVersion="8"
           Desc="Query ClickHouse with the official JDBC driver from Power BI, SQL Server Linked Server via ZappySys Data Gateway, Crystal Reports, SSRS, Azure Data Factory, and other ODBC tools -- almost no coding required."
           Logo="https://cdn.zappysys.com/api/Images/logos/clickhouse-connector.png"
           HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc">

    <VersionHistory>
      <Change Ver="1" Date="2026-09-14" Type="New">Initial JDBC Bridge catalog version. Hands-free Maven JAR download. Auth Notes and SQL examples for ODBC apps.</Change>
    </VersionHistory>
    <Template>
        <Param Name="DriverDownloadPageLink"
               Value="https://clickhouse.com/docs/integrations/language-clients/java/jdbc" />
        <Param Name="MvnRepositoryDriverDownloadLink"
               Value="https://mvnrepository.com/artifact/com.clickhouse/clickhouse-jdbc" />
        <Param Name="DriverDownloadLinks"
               Hidden="True"
               Value="clickhouse-jdbc-0.9.0-all.jar=https://repo1.maven.org/maven2/com/clickhouse/clickhouse-jdbc/0.9.0/clickhouse-jdbc-0.9.0-all.jar" />
    </Template>

    <Auths>
        <Auth Name="Http"
              Label="HTTP"
              ConnStr="jdbc:clickhouse://[$HostName$]:[$Port$]/[$Database$]"
              HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc">
            <Params>
                <Param Name="DriverClass" Label="Driver class" Required="False" Value="com.clickhouse.jdbc.ClickHouseDriver" Desc="Optional. Leave blank to auto-detect from the JAR unless SPI is ambiguous (e.g. com.clickhouse.jdbc.ClickHouseDriver)." HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc" />
                <Param Name="DriverFilePaths" Editor="FileOpen" Label="JDBC driver file(s)" Required="True" Value="{DownloadFolder}\clickhouse-jdbc-0.9.0-all.jar" Desc="Filled by the wizard after download. Separate multiple JARs with a semicolon (e.g. C:\ZappySys\Jdbc\MyConnector\driver.jar)." HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc" />
                <Param Name="HostName" Label="Host" Required="True" Value="MyHostName" Desc="JDBC host name or IP (e.g. MyHostName)." HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc" />
                <Param Name="Port" Label="TCP port" Required="True" Value="8123" Desc="JDBC port (e.g. 8123)." HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc" />
                <Param Name="Database" Label="Database name" Required="False" Value="MyDatabase" Desc="Database, schema, or catalog name (e.g. MyDatabase)." HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc" />
                <Param Name="UserName" Label="User name" Required="False" Desc="Database user. Leave empty if the server allows anonymous JDBC." HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc" />
                <Param Name="Password" Label="Password" Required="False" Secret="True" Desc="Database password. Leave empty if no password is required." HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc" />
            </Params>
            <Notes>
                <![CDATA[<p>ClickHouse HTTP JDBC from Power BI, SQL Server Linked Server via ZappySys Data Gateway, Crystal Reports, SSRS, Azure Data Factory, and other ODBC tools.</p>
<ol>
  <li>Copy the ClickHouse HTTP host and port (default <code>8123</code>).</li><li>Create a user (<code>CREATE USER</code>) with access to the database. Paste user and password.</li><li>Use the HTTPS Auth when the endpoint is TLS (often Cloud, port 8443).</li>
  <li>Finish the wizard. Then click <strong>Test Connection</strong> on the DSN Main UI (the wizard does not run Test Connection).</li><li>Done. You can query from C#, Python, PowerShell, and ODBC apps.</li>
</ol>]]>
            </Notes>
        </Auth>
        <Auth Name="Https"
              Label="HTTPS"
              ConnStr="jdbc:clickhouse:https://[$HostName$]:[$Port$]/[$Database$]"
              HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc">
            <Params>
                <Param Name="DriverClass" Label="Driver class" Required="False" Value="com.clickhouse.jdbc.ClickHouseDriver" Desc="Optional. Leave blank to auto-detect from the JAR unless SPI is ambiguous (e.g. com.clickhouse.jdbc.ClickHouseDriver)." HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc" />
                <Param Name="DriverFilePaths" Editor="FileOpen" Label="JDBC driver file(s)" Required="True" Value="{DownloadFolder}\clickhouse-jdbc-0.9.0-all.jar" Desc="Filled by the wizard after download. Separate multiple JARs with a semicolon (e.g. C:\ZappySys\Jdbc\MyConnector\driver.jar)." HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc" />
                <Param Name="HostName" Label="Host" Required="True" Value="MyHostName" Desc="JDBC host name or IP (e.g. MyHostName)." HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc" />
                <Param Name="Port" Label="TCP port" Required="True" Value="8443" Desc="JDBC port (e.g. 8443)." HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc" />
                <Param Name="Database" Label="Database name" Required="False" Value="MyDatabase" Desc="Database, schema, or catalog name (e.g. MyDatabase)." HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc" />
                <Param Name="UserName" Label="User name" Required="False" Desc="Database user. Leave empty if the server allows anonymous JDBC." HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc" />
                <Param Name="Password" Label="Password" Required="False" Secret="True" Desc="Database password. Leave empty if no password is required." HelpLink="https://clickhouse.com/docs/integrations/language-clients/java/jdbc" />
            </Params>
            <Notes>
                <![CDATA[<p>ClickHouse HTTPS JDBC from Power BI, SQL Server Linked Server via ZappySys Data Gateway, Crystal Reports, SSRS, Azure Data Factory, and other ODBC tools.</p>
<ol>
  <li>Use the Cloud or TLS HTTP interface (often port <code>8443</code>).</li><li>Create a user in the ClickHouse Cloud console. Paste user and password.</li><li>Do not disable TLS on Cloud.</li>
  <li>Finish the wizard. Then click <strong>Test Connection</strong> on the DSN Main UI (the wizard does not run Test Connection).</li><li>Done. You can query from C#, Python, PowerShell, and ODBC apps.</li>
</ol>]]>
            </Notes>
        </Auth>
    </Auths>

    <Examples>
        <Example Default="True" Group="ODBC" Slug="list-tables" Label="List tables" HelpLink="https://clickhouse.com/docs/sql-reference/statements/select">
            <Desc><![CDATA[<p>Lists tables available to this connection. Use this in Power BI or a SQL Server Linked Server to confirm the catalog before building reports.</p>]]></Desc>
            <Code>
                <![CDATA[SHOW TABLES]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="select-rows" Label="Select rows" HelpLink="https://clickhouse.com/docs/sql-reference/statements/select">
            <Desc><![CDATA[<p>Returns rows from <code>default.MyTable</code>. Replace the identifier with your catalog object. Works in Excel, SSRS, and Crystal Reports.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT * FROM default.MyTable]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="filter-rows" Label="Filter with WHERE" HelpLink="https://clickhouse.com/docs/sql-reference/statements/select">
            <Desc><![CDATA[<p>Returns matching rows from <code>default.MyTable</code>. Swap the column and literal for your schema.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT * FROM default.MyTable
WHERE id = 1]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="join-tables" Label="Join tables" HelpLink="https://clickhouse.com/docs/sql-reference/statements/select">
            <Desc><![CDATA[<p>Joins two tables on a key. Use in Azure Data Factory or SSIS when you need a combined extract.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT a.id, a.name, b.amount
FROM default.MyTable AS a
JOIN my_other_table AS b ON a.id = b.parent_id]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="group-by" Label="Aggregate with GROUP BY" HelpLink="https://clickhouse.com/docs/sql-reference/statements/select">
            <Desc><![CDATA[<p>Counts rows per group. Typical Power BI import pattern before a visual.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT status, COUNT(*) AS row_count
FROM default.MyTable
GROUP BY status]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="having" Label="Filter groups with HAVING" HelpLink="https://clickhouse.com/docs/sql-reference/statements/select">
            <Desc><![CDATA[<p>Keeps groups whose count is at least 10.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT status, COUNT(*) AS row_count
FROM default.MyTable
GROUP BY status
HAVING COUNT(*) >= 10]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="order-limit" Label="Order and limit" HelpLink="https://clickhouse.com/docs/sql-reference/statements/select">
            <Desc><![CDATA[<p>Returns the first 100 rows ordered by a column. Useful for preview in Excel or Crystal Reports.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT * FROM default.MyTable
ORDER BY id
LIMIT 100]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="count-all" Label="Count rows" HelpLink="https://clickhouse.com/docs/sql-reference/statements/select">
            <Desc><![CDATA[<p>Returns the number of rows in <code>default.MyTable</code>.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT COUNT(*) AS row_count FROM default.MyTable]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="case-expr" Label="CASE expression" HelpLink="https://clickhouse.com/docs/sql-reference/statements/select">
            <Desc><![CDATA[<p>Maps a column to labels with <code>CASE</code>.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT id,
       CASE WHEN status = 'A' THEN 'Active' ELSE 'Other' END AS status_label
FROM default.MyTable]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="select-list" Label="Select specific columns" HelpLink="https://clickhouse.com/docs/sql-reference/statements/select">
            <Desc><![CDATA[<p>Returns a column list instead of star. Prefer this in Linked Server views.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT id, name, status
FROM default.MyTable]]>
            </Code>
        </Example>
    </Examples>
</ApiConfig>
