﻿<?xml version="1.0" encoding="utf-8"?>

<!-- EngineVersion = Java version -->
<ApiConfig Name="Apache Kylin"
           Slug="apache-kylin-connector"
           Type="JDBC"
           Category="big-data"
           Id="E17AF0E1-C630-5625-8EE7-375CA1DABC86"
           Version="1"
           EngineVersion="8"
           Desc="Query Apache Kylin 5 cubes with JDBC 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/apache-kylin-connector.png"
           HelpLink="https://kylin.apache.org/docs/tutorial/jdbc">

    <VersionHistory>
      <Change Ver="1" Date="2026-09-15" Type="New">Initial JDBC Bridge catalog version. Hands-free JAR download. Auth Notes and SQL examples for ODBC apps.</Change>
    </VersionHistory>
    <Template>
        <Param Name="DriverDownloadPageLink"
               Value="https://kylin.apache.org/docs/tutorial/jdbc" />
        <Param Name="MvnRepositoryDriverDownloadLink"
               Value="https://mvnrepository.com/artifact/org.apache.kylin/kylin-jdbc" />
        <Param Name="DriverDownloadLinks"
               Hidden="True"
               Value="kylin-jdbc-5.0.4.jar=https://repo1.maven.org/maven2/org/apache/kylin/kylin-jdbc/5.0.4/kylin-jdbc-5.0.4.jar" />
    </Template>

    <Auths>
        <Auth Name="Default"
              Label="Default"
              ConnStr="jdbc:kylin://[$HostName$]:[$Port$]/[$Project$]"
              HelpLink="https://kylin.apache.org/docs/tutorial/jdbc">
            <Params>
                <Param Name="DriverClass" Label="Driver class" Required="False" Value="org.apache.kylin.jdbc.Driver" Desc="Optional. Leave blank to auto-detect from the JAR unless SPI is ambiguous (e.g. org.apache.kylin.jdbc.Driver)." HelpLink="https://kylin.apache.org/docs/tutorial/jdbc" />
                <Param Name="DriverFilePaths" Editor="FileOpen" Label="JDBC driver file(s)" Required="True" Value="{DownloadFolder}\kylin-jdbc-5.0.4.jar" Desc="Filled by the wizard after download. Separate multiple JARs with a semicolon (e.g. C:\ZappySys\Jdbc\MyConnector\driver.jar)." HelpLink="https://kylin.apache.org/docs/tutorial/jdbc" />
                <Param Name="HostName" Label="Host" Required="True" Value="MyHostName" Desc="JDBC host name or IP (e.g. MyHostName)." HelpLink="https://kylin.apache.org/docs/tutorial/jdbc" />
                <Param Name="Port" Label="TCP port" Required="True" Value="7070" Desc="JDBC port (e.g. 7070)." HelpLink="https://kylin.apache.org/docs/tutorial/jdbc" />
                <Param Name="Project" Label="Project" Required="True" Value="MyProject" Desc="Kylin project name (e.g. MyProject)." HelpLink="https://kylin.apache.org/docs/tutorial/jdbc" />
                <Param Name="UserName" Label="User name" Required="True" Desc="Kylin REST user with query permission on the project." HelpLink="https://kylin.apache.org/docs/tutorial/jdbc" />
                <Param Name="Password" Label="Password" Required="True" Secret="True" Desc="Kylin REST password for that user." HelpLink="https://kylin.apache.org/docs/tutorial/jdbc" />
            </Params>
            <Notes>
                <![CDATA[<p>Apache Kylin 5 JDBC from Power BI, SQL Server Linked Server via ZappySys Data Gateway, Crystal Reports, SSRS, Azure Data Factory, and other ODBC tools. User and password are the Kylin REST user (the same account you use in the Kylin web UI), not a Hadoop principal unless you configured that.</p>
<ol>
  <li>Note the Kylin query/REST host and HTTP port (default <code>7070</code>) and the project name.</li>
  <li>In the Kylin web UI create (or reuse) a user with query permission on that project. Paste user and password here. Do not use a personal employee login for unattended refresh.</li>
  <li>The wizard downloads <code>kylin-jdbc</code> 5.0.4 (shaded). After Finish, replace the host (e.g. MyHostName) and project in the JDBC URL.</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="Ssl"
              Label="SSL"
              ConnStr="jdbc:kylin://[$HostName$]:[$Port$]/[$Project$]?ssl=[$Ssl$]"
              HelpLink="https://kylin.apache.org/docs/tutorial/jdbc">
            <Params>
                <Param Name="DriverClass" Label="Driver class" Required="False" Value="org.apache.kylin.jdbc.Driver" Desc="Optional. Leave blank to auto-detect from the JAR unless SPI is ambiguous (e.g. org.apache.kylin.jdbc.Driver)." HelpLink="https://kylin.apache.org/docs/tutorial/jdbc" />
                <Param Name="DriverFilePaths" Editor="FileOpen" Label="JDBC driver file(s)" Required="True" Value="{DownloadFolder}\kylin-jdbc-5.0.4.jar" Desc="Filled by the wizard after download. Separate multiple JARs with a semicolon (e.g. C:\ZappySys\Jdbc\MyConnector\driver.jar)." HelpLink="https://kylin.apache.org/docs/tutorial/jdbc" />
                <Param Name="HostName" Label="Host" Required="True" Value="MyHostName" Desc="JDBC host name or IP (e.g. MyHostName)." HelpLink="https://kylin.apache.org/docs/tutorial/jdbc" />
                <Param Name="Port" Label="TCP port" Required="True" Value="443" Desc="JDBC port (e.g. 443)." HelpLink="https://kylin.apache.org/docs/tutorial/jdbc" />
                <Param Name="Project" Label="Project" Required="True" Value="MyProject" Desc="Kylin project name (e.g. MyProject)." HelpLink="https://kylin.apache.org/docs/tutorial/jdbc" />
                <Param Name="UserName" Label="User name" Required="True" Desc="Kylin REST user with query permission on the project." HelpLink="https://kylin.apache.org/docs/tutorial/jdbc" />
                <Param Name="Password" Label="Password" Required="True" Secret="True" Desc="Kylin REST password for that user." HelpLink="https://kylin.apache.org/docs/tutorial/jdbc" />
                <Param Name="Ssl" Label="SSL" Required="False" Options="Notset=;Yes=true;No=false" Value="true" Desc="Set true so the driver calls Kylin over HTTPS (e.g. Yes from the dropdown). Use the server HTTPS port." HelpLink="https://kylin.apache.org/docs/tutorial/jdbc" />
            </Params>
            <Notes>
                <![CDATA[<p>Kylin 5 JDBC over HTTPS. User and password remain the Kylin REST user.</p>
<ol>
  <li>Use the HTTPS port of the Kylin server (often 443 or a custom TLS port). This Auth sets <code>ssl=true</code>.</li>
  <li>Create a Kylin REST user with query access to the project. Paste user and password.</li>
  <li>After Finish, replace host, port, and project. If the certificate is private, import it into the Java truststore used by JDBC Bridge.</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://kylin.apache.org/docs/tutorial/query">
            <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[SELECT * FROM KYLIN_SALES LIMIT 100]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="select-rows" Label="Select rows" HelpLink="https://kylin.apache.org/docs/tutorial/query">
            <Desc><![CDATA[<p>Returns rows from <code>KYLIN_SALES</code>. Replace the identifier with your catalog object. Works in Excel, SSRS, and Crystal Reports.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT * FROM KYLIN_SALES]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="filter-rows" Label="Filter with WHERE" HelpLink="https://kylin.apache.org/docs/tutorial/query">
            <Desc><![CDATA[<p>Returns matching rows from <code>KYLIN_SALES</code>. Swap the column and literal for your schema.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT * FROM KYLIN_SALES
WHERE id = 1]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="join-tables" Label="Join tables" HelpLink="https://kylin.apache.org/docs/tutorial/query">
            <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 KYLIN_SALES 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://kylin.apache.org/docs/tutorial/query">
            <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 KYLIN_SALES
GROUP BY status]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="having" Label="Filter groups with HAVING" HelpLink="https://kylin.apache.org/docs/tutorial/query">
            <Desc><![CDATA[<p>Keeps groups whose count is at least 10.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT status, COUNT(*) AS row_count
FROM KYLIN_SALES
GROUP BY status
HAVING COUNT(*) >= 10]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="order-limit" Label="Order and limit" HelpLink="https://kylin.apache.org/docs/tutorial/query">
            <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 KYLIN_SALES
ORDER BY id
LIMIT 100]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="count-all" Label="Count rows" HelpLink="https://kylin.apache.org/docs/tutorial/query">
            <Desc><![CDATA[<p>Returns the number of rows in <code>KYLIN_SALES</code>.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT COUNT(*) AS row_count FROM KYLIN_SALES]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="case-expr" Label="CASE expression" HelpLink="https://kylin.apache.org/docs/tutorial/query">
            <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 KYLIN_SALES]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="select-list" Label="Select specific columns" HelpLink="https://kylin.apache.org/docs/tutorial/query">
            <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 KYLIN_SALES]]>
            </Code>
        </Example>
    </Examples>
</ApiConfig>
