<?xml version="1.0" encoding="utf-8"?>

<!-- EngineVersion = Java version -->
<ApiConfig Name="HSQLDB"
           Slug="hsqldb-connector"
           Type="JDBC"
           Category="database"
           Id="6131E3E9-2ABB-53D0-86D9-3321ED7094BC"
           Version="1"
           EngineVersion="8"
           Desc="Read and write HyperSQL (HSQLDB) embedded or server databases 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/hsqldb-connector.png"
           HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html">

    <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://hsqldb.org/download/" />
        <Param Name="MvnRepositoryDriverDownloadLink"
               Value="https://mvnrepository.com/artifact/org.hsqldb/hsqldb" />
        <Param Name="DriverDownloadLinks"
               Hidden="True"
               Value="hsqldb-2.7.4-jdk8.jar=https://repo1.maven.org/maven2/org/hsqldb/hsqldb/2.7.4/hsqldb-2.7.4-jdk8.jar" />
    </Template>

    <Auths>
        <Auth Name="Memory"
              Label="In-memory"
              ConnStr="jdbc:hsqldb:mem:[$Database$]"
              HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html">
            <Params>
                <Param Name="DriverClass" Label="Driver class" Required="False" Value="org.hsqldb.jdbc.JDBCDriver" Desc="Optional. Leave blank to auto-detect from the JAR unless SPI is ambiguous (e.g. org.hsqldb.jdbc.JDBCDriver)." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
                <Param Name="DriverFilePaths" Editor="FileOpen" Label="JDBC driver file(s)" Required="True" Value="{DownloadFolder}\hsqldb-2.7.4-jdk8.jar" Desc="Filled by the wizard after download. Separate multiple JARs with a semicolon (e.g. C:\ZappySys\Jdbc\MyConnector\driver.jar)." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
                <Param Name="Database" Label="Database name" Required="False" Value="MyDatabase" Desc="Database, schema, or catalog name (e.g. MyDatabase)." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
                <Param Name="UserName" Label="User name" Required="False" Desc="Database user. Leave empty if the server allows anonymous JDBC." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
                <Param Name="Password" Label="Password" Required="False" Secret="True" Desc="Database password. Leave empty if no password is required." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
            </Params>
            <Notes>
                <![CDATA[<p>HSQLDB in-memory 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>No server. Data lasts for this DSN process only.</li><li>Default user is often <code>SA</code> with empty password.</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="File"
              Label="Local file"
              ConnStr="jdbc:hsqldb:file:{DownloadFolder}\hsqldb"
              HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html">
            <Params>
                <Param Name="DriverClass" Label="Driver class" Required="False" Value="org.hsqldb.jdbc.JDBCDriver" Desc="Optional. Leave blank to auto-detect from the JAR unless SPI is ambiguous (e.g. org.hsqldb.jdbc.JDBCDriver)." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
                <Param Name="DriverFilePaths" Editor="FileOpen" Label="JDBC driver file(s)" Required="True" Value="{DownloadFolder}\hsqldb-2.7.4-jdk8.jar" Desc="Filled by the wizard after download. Separate multiple JARs with a semicolon (e.g. C:\ZappySys\Jdbc\MyConnector\driver.jar)." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
                <Param Name="UserName" Label="User name" Required="False" Desc="Database user. Leave empty if the server allows anonymous JDBC." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
                <Param Name="Password" Label="Password" Required="False" Secret="True" Desc="Database password. Leave empty if no password is required." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
            </Params>
            <Notes>
                <![CDATA[<p>HSQLDB file 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>The wizard downloads the JDK 8 JAR into <code>{DownloadFolder}</code>. The database files are created as <code>hsqldb.*</code> in that folder.</li><li>Default user <code>SA</code> / empty password unless you set one.</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="Server"
              Label="HSQL server"
              ConnStr="jdbc:hsqldb:hsql://[$HostName$]:[$Port$]/[$Database$]"
              HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html">
            <Params>
                <Param Name="DriverClass" Label="Driver class" Required="False" Value="org.hsqldb.jdbc.JDBCDriver" Desc="Optional. Leave blank to auto-detect from the JAR unless SPI is ambiguous (e.g. org.hsqldb.jdbc.JDBCDriver)." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
                <Param Name="DriverFilePaths" Editor="FileOpen" Label="JDBC driver file(s)" Required="True" Value="{DownloadFolder}\hsqldb-2.7.4-jdk8.jar" Desc="Filled by the wizard after download. Separate multiple JARs with a semicolon (e.g. C:\ZappySys\Jdbc\MyConnector\driver.jar)." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
                <Param Name="HostName" Label="Host" Required="True" Value="MyHostName" Desc="JDBC host name or IP (e.g. MyHostName)." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
                <Param Name="Port" Label="TCP port" Required="True" Value="9001" Desc="JDBC port (e.g. 9001)." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
                <Param Name="Database" Label="Database name" Required="False" Value="MyDatabase" Desc="Database, schema, or catalog name (e.g. MyDatabase)." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
                <Param Name="UserName" Label="User name" Required="False" Desc="Database user. Leave empty if the server allows anonymous JDBC." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
                <Param Name="Password" Label="Password" Required="False" Secret="True" Desc="Database password. Leave empty if no password is required." HelpLink="https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html" />
            </Params>
            <Notes>
                <![CDATA[<p>HSQLDB server 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>Start an HSQL server (default port <code>9001</code>) or use an existing one.</li><li>Replace host, port, and catalog. Fill user and password from that server.</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://hsqldb.org/doc/2.0/guide/dataaccess-chapt.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 TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PUBLIC' ORDER BY TABLE_NAME]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="select-rows" Label="Select rows" HelpLink="https://hsqldb.org/doc/2.0/guide/dataaccess-chapt.html">
            <Desc><![CDATA[<p>Returns rows from <code>PUBLIC.MY_TABLE</code>. Replace the identifier with your catalog object. Works in Excel, SSRS, and Crystal Reports.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT * FROM PUBLIC.MY_TABLE]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="filter-rows" Label="Filter with WHERE" HelpLink="https://hsqldb.org/doc/2.0/guide/dataaccess-chapt.html">
            <Desc><![CDATA[<p>Returns matching rows from <code>PUBLIC.MY_TABLE</code>. Swap the column and literal for your schema.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT * FROM PUBLIC.MY_TABLE
WHERE id = 1]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="join-tables" Label="Join tables" HelpLink="https://hsqldb.org/doc/2.0/guide/dataaccess-chapt.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 PUBLIC.MY_TABLE 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://hsqldb.org/doc/2.0/guide/dataaccess-chapt.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 PUBLIC.MY_TABLE
GROUP BY status]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="having" Label="Filter groups with HAVING" HelpLink="https://hsqldb.org/doc/2.0/guide/dataaccess-chapt.html">
            <Desc><![CDATA[<p>Keeps groups whose count is at least 10.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT status, COUNT(*) AS row_count
FROM PUBLIC.MY_TABLE
GROUP BY status
HAVING COUNT(*) >= 10]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="order-limit" Label="Order and limit" HelpLink="https://hsqldb.org/doc/2.0/guide/dataaccess-chapt.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 PUBLIC.MY_TABLE
ORDER BY id
LIMIT 100]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="count-all" Label="Count rows" HelpLink="https://hsqldb.org/doc/2.0/guide/dataaccess-chapt.html">
            <Desc><![CDATA[<p>Returns the number of rows in <code>PUBLIC.MY_TABLE</code>.</p>]]></Desc>
            <Code>
                <![CDATA[SELECT COUNT(*) AS row_count FROM PUBLIC.MY_TABLE]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="case-expr" Label="CASE expression" HelpLink="https://hsqldb.org/doc/2.0/guide/dataaccess-chapt.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 PUBLIC.MY_TABLE]]>
            </Code>
        </Example>

        <Example Group="ODBC" Slug="select-list" Label="Select specific columns" HelpLink="https://hsqldb.org/doc/2.0/guide/dataaccess-chapt.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 PUBLIC.MY_TABLE]]>
            </Code>
        </Example>
    </Examples>
</ApiConfig>
