<?xml version="1.0" encoding="utf-8"?>

<!-- EngineVersion = Java version -->
<ApiConfig Name="Arrow Flight SQL"
           Slug="arrow-flight-sql-connector"
           Type="JDBC"
           Category="database"
           Id="30409E1D-A5BD-5F24-9964-74D841192DE1"
           Version="1"
           EngineVersion="11"
           Desc="Query any Arrow Flight SQL endpoint 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/arrow-flight-sql-connector.png"
           HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html">

    <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://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html" />
        <Param Name="MvnRepositoryDriverDownloadLink"
               Value="https://mvnrepository.com/artifact/org.apache.arrow/flight-sql-jdbc-driver" />
        <Param Name="DriverDownloadLinks"
               Hidden="True"
               Value="flight-sql-jdbc-driver-19.0.0.jar=https://repo1.maven.org/maven2/org/apache/arrow/flight-sql-jdbc-driver/19.0.0/flight-sql-jdbc-driver-19.0.0.jar" />
    </Template>

    <Auths>
        <Auth Name="UserPassword"
              Label="User and password"
              ConnStr="jdbc:arrow-flight-sql://[$HostName$]:[$Port$]"
              HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html">
            <Params>
                <Param Name="DriverClass" Label="Driver class" Required="False" Value="org.apache.arrow.driver.jdbc.ArrowFlightJdbcDriver" Desc="Optional. Leave blank to auto-detect from the JAR unless SPI is ambiguous (e.g. org.apache.arrow.driver.jdbc.ArrowFlightJdbcDriver)." HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html" />
                <Param Name="DriverFilePaths" Editor="FileOpen" Label="JDBC driver file(s)" Required="True" Value="{DownloadFolder}\flight-sql-jdbc-driver-19.0.0.jar" Desc="Filled by the wizard after download. Separate multiple JARs with a semicolon (e.g. C:\ZappySys\Jdbc\MyConnector\driver.jar)." HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html" />
                <Param Name="HostName" Label="Host" Required="True" Value="MyHostName" Desc="JDBC host name or IP (e.g. MyHostName)." HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html" />
                <Param Name="Port" Label="TCP port" Required="True" Value="32010" Desc="JDBC port (e.g. 32010)." HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html" />
                <Param Name="UserName" Label="User name" Required="True" Desc="Database user. Leave empty if the server allows anonymous JDBC." HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html" />
                <Param Name="Password" Label="Password" Required="True" Secret="True" Desc="Database password. Leave empty if no password is required." HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html" />
                <Param Name="useEncryption" Label="Use encryption" Required="False" Value="true" Desc="Set true for TLS (default). Set false only for a local plaintext Flight SQL server." HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html" />
            </Params>
            <Notes>
                <![CDATA[<p>Generic Arrow Flight SQL JDBC from Power BI, SQL Server Linked Server via ZappySys Data Gateway, Crystal Reports, SSRS, Azure Data Factory, and other ODBC tools. This tile is the protocol driver. <strong>InfluxDB 3 already has its own catalog tile</strong> -- use that for Influx instead of retargeting this DSN.</p>
<ol>
  <li>Note the Flight SQL host and port (Dremio often uses <code>32010</code>; other servers differ). Default encryption is on.</li>
  <li>Create a database user on the Flight SQL server. Paste user and password.</li>
  <li>If the Bridge JVM is Java 16 or newer, add <code>--add-opens=java.base/java.nio=ALL-UNNAMED</code> to the JDBC Bridge JVM options when Arrow reports module-access errors.</li>
  <li>After Finish, replace host and port. Set <code>useEncryption=false</code> only for a local plaintext lab.</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="Token"
              Label="Token"
              ConnStr="jdbc:arrow-flight-sql://[$HostName$]:[$Port$]"
              HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html">
            <Params>
                <Param Name="DriverClass" Label="Driver class" Required="False" Value="org.apache.arrow.driver.jdbc.ArrowFlightJdbcDriver" Desc="Optional. Leave blank to auto-detect from the JAR unless SPI is ambiguous (e.g. org.apache.arrow.driver.jdbc.ArrowFlightJdbcDriver)." HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html" />
                <Param Name="DriverFilePaths" Editor="FileOpen" Label="JDBC driver file(s)" Required="True" Value="{DownloadFolder}\flight-sql-jdbc-driver-19.0.0.jar" Desc="Filled by the wizard after download. Separate multiple JARs with a semicolon (e.g. C:\ZappySys\Jdbc\MyConnector\driver.jar)." HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html" />
                <Param Name="HostName" Label="Host" Required="True" Value="MyHostName" Desc="JDBC host name or IP (e.g. MyHostName)." HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html" />
                <Param Name="Port" Label="TCP port" Required="True" Value="32010" Desc="JDBC port (e.g. 32010)." HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html" />
                <Param Name="token" Label="Token" Required="True" Secret="True" Desc="Flight SQL bearer / API token. Create it in the server UI or CLI." HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html" />
                <Param Name="useEncryption" Label="Use encryption" Required="False" Value="true" Desc="Set true for TLS (default). Set false only for a local plaintext Flight SQL server." HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html" />
            </Params>
            <Notes>
                <![CDATA[<p>Flight SQL token authentication (bearer / PAT). Still a generic protocol tile -- InfluxDB 3 keeps its own connector.</p>
<ol>
  <li>Create an API token or personal access token in the Flight SQL server UI (same idea as a Stripe secret key).</li>
  <li>Paste the token into <strong>Token</strong>. Leave user/password empty unless the server requires both.</li>
  <li>Java 16+ may need <code>--add-opens=java.base/java.nio=ALL-UNNAMED</code> on the Bridge JVM.</li>
  <li>After Finish, replace host and port. Cloud endpoints often use 443 with TLS.</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://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html">
            <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 information_schema.tables]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="select-rows" Label="Select rows" HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html">
            <Desc><![CDATA[<p>Returns rows from <code>MyTable</code>. Replace the identifier with your catalog object. Works in Excel, SSRS, and Crystal Reports.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT * FROM MyTable]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="filter-rows" Label="Filter with WHERE" HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html">
            <Desc><![CDATA[<p>Returns matching rows from <code>MyTable</code>. Swap the column and literal for your schema.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT * FROM MyTable
WHERE id = 1]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="join-tables" Label="Join tables" HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html">
            <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 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://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html">
            <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 MyTable
GROUP BY status]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="having" Label="Filter groups with HAVING" HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html">
            <Desc><![CDATA[<p>Keeps groups whose count is at least 10.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT status, COUNT(*) AS row_count
FROM MyTable
GROUP BY status
HAVING COUNT(*) >= 10]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="order-limit" Label="Order and limit" HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html">
            <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 MyTable
ORDER BY id
LIMIT 100]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="count-all" Label="Count rows" HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html">
            <Desc><![CDATA[<p>Returns the number of rows in <code>MyTable</code>.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT COUNT(*) AS row_count FROM MyTable]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="case-expr" Label="CASE expression" HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html">
            <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 MyTable]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="select-list" Label="Select specific columns" HelpLink="https://arrow.apache.org/docs/java/flight_sql_jdbc_driver.html">
            <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 MyTable]]>
            </Code>
        </Example>
    </Examples>
</ApiConfig>
