Wiki source code of Configure HSQLDB
Last modified by Eleni Cojocariu on 2026/11/25 14:47
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | To configure XWiki to use [[HSQLDB as the database>>doc:documentation.xs.admin.installation.database.configure-hsqldb.hsqldb-limitations.WebHome]], which runs embedded in the same JVM as XWiki: | ||
| 2 | |||
| 3 | 1. Make sure you have already installed and [[configured a servlet container>>doc:documentation.xs.admin.installation.servlet-container.WebHome]] for XWiki (e.g. [[Tomcat>>doc:documentation.xs.admin.installation.servlet-container.configure-tomcat.WebHome]] or [[Jetty>>doc:documentation.xs.admin.installation.servlet-container.configure-jetty.WebHome]]), with the [[XWiki WAR>>doc:documentation.xs.admin.installation.methods.install-xwiki-war.WebHome]] file extracted/deployed. | ||
| 4 | 1. Check that the ##hsqldb*.jar## driver is present in the ##WEB-INF/lib## directory of the expanded XWiki WAR.((( | ||
| 5 | If it is missing, download it from the [[HSQLDB website>>https://hsqldb.org/]] or from the [[Maven Central repository>>https://central.sonatype.com/artifact/org.hsqldb/hsqldb?smo=true]] and copy it there. | ||
| 6 | ))) | ||
| 7 | 1. Edit the ##WEB-INF/hibernate.cfg.xml## file and uncomment the HSQLDB configuration block. The database files are created under the [[permanent directory>>doc:documentation.xs.admin.installation.directories.permanent-directory.WebHome]]; replace ##${environment.permanentDirectory}/database/xwiki_db## with an absolute path if you want them elsewhere.((( | ||
| 8 | {{code language="xml"}} | ||
| 9 | <property name="hibernate.connection.url">jdbc:hsqldb:file:${environment.permanentDirectory}/database/xwiki_db;shutdown=true</property> | ||
| 10 | <property name="hibernate.connection.username">sa</property> | ||
| 11 | <property name="hibernate.connection.password"></property> | ||
| 12 | <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property> | ||
| 13 | |||
| 14 | <property name="hibernate.connection.charSet">UTF-8</property> | ||
| 15 | <property name="hibernate.connection.useUnicode">true</property> | ||
| 16 | <property name="hibernate.connection.characterEncoding">utf8</property> | ||
| 17 | {{/code}} | ||
| 18 | ))) | ||
| 19 | 1. Start or restart the application server. The HSQLDB database files are created automatically in the location specified by the ##connection.url## property. | ||
| 20 | 1. Verify that the ##xwiki_db.script## and ##xwiki_db.properties## database files exist in the directory you configured. |