This question is quite dated, but I recently ran into a similar situation. I tried to access the embedded HSQLDB database running in a TomEE server.
@fredt's answer gave me the decisive hint, but I was still struggling to find out all the details.
Here is my solution:
Add a servlet mapping for org.hsqldb.server.Servlet to either a web.xml or web-fragment.xml descriptor file:
<servlet>
<servlet-name>hsqldb</servlet-name>
<servlet-class>org.hsqldb.server.Servlet</servlet-class>
<init-param>
<param-name>hsqldb.server.database</param-name>
<param-value>${catalina.base}/hsqldb/db</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>hsqldb</servlet-name>
<url-pattern>/hsqldb</url-pattern>
</servlet-mapping>
Using the parameter hsqldb.server.database you can specify the location of your database. Because Tomcat/Tomcat distinguishes between CATALINA_HOME and CATALINA_BASE, simply specifying a relative path like "hsqldb/db" is not enough.
But you can use system properties provided by Tomcat/TomEE, like ${catalina.base} to make your path absolute.
After starting your server the HSQLDB database can be accessed via the URL
jdbc:hsqldb:http://localhost:8080/<context-path>/hsqldb