web.xml for run HSQLDB in Servlet mode


/ Published in: XML
Save to your folder(s)

place hsqldb.jar in <servletDir>/WEB-INF/lib,
make file <servletDir>/WEB-INF/web.xml with following content
& your DB will reachable via URL:
http://<tomcatHost>:<tomcatPort>/<servletDir>


Copy this code and paste it in your HTML
  1. <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd" >
  2. <web-app>
  3. <servlet>
  4. <servlet-name>hsql</servlet-name>
  5. <servlet-class>org.hsqldb.server.Servlet</servlet-class>
  6. <!-- Example of absolute DB path, for path relative ./WEB_INF add parameter hsqldb.server.use_web-inf_path = true -->
  7. <init-param>
  8. <param-name>hsqldb.server.database</param-name>
  9. <param-value>/var/db/hsql01</param-value>
  10. </init-param>
  11. </servlet>
  12. <servlet-mapping>
  13. <servlet-name>hsql</servlet-name>
  14. <url-pattern>*</url-pattern>
  15. </servlet-mapping>
  16. </web-app>

URL: hsqldb_servlet_web_xml

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.