<
From version < 7.1 >
edited by Vincent Massol
on 2008/06/20
To version < 8.1 >
edited by Vincent Massol
on 2012/06/11
>
Change comment: Document converted from syntax xwiki/1.0 to syntax xwiki/2.1

Summary

Details

Page properties
Syntax
... ... @@ -1,1 +1,1 @@
1 -XWiki 1.0
1 +XWiki 2.1
Content
... ... @@ -1,28 +1,35 @@
1 -1 HSQL Installation
1 += HSQL Installation =
2 2  
3 3  Follow these instructions:
4 4  
5 -* HSQL is a very simple database to configure as you don't need to install nor to start it before being able to use it. It comes as a single JAR file named <tt>hsqldb*.jar</tt>. If your XWiki WAR doesn't have it in <tt>WEB-INF/lib</tt> you'll need to download it and copy it there. You can download it from the [HSQLDB web site>http://www.hsqldb.org/] or directly from the [Maven Central Repository>http://repo1.maven.org/maven2/hsqldb/hsqldb/].
6 -* Once this is done, you need to tell XWiki to use HSQL and to tell it where the database files will be created. To do this, edit the <tt>WEB-INF/hibernate.cfg.xml</tt> file where you have expanded the XWiki WAR file and replace the matching properties with the following ones:
5 +* HSQL is a very simple database to configure as you don't need to install nor to start it before being able to use it. It comes as a single JAR file named ##hsqldb*.jar##. If your XWiki WAR doesn't have it in ##WEB-INF/lib## you'll need to download it and copy it there. You can download it from the [[HSQLDB web site>>http://www.hsqldb.org/]] or directly from the [[Maven Central Repository>>http://repo1.maven.org/maven2/hsqldb/hsqldb/]].
6 +* Once this is done, you need to tell XWiki to use HSQL and to tell it where the database files will be created. To do this, edit the ##WEB-INF/hibernate.cfg.xml## file where you have expanded the XWiki WAR file and replace the matching properties with the following ones:
7 7  
8 -{code}
8 +{{code}}
9 9  <property name="connection.url">jdbc:hsqldb:file:[DATABASE_LOCATION];shutdown=true</property>
10 10  <property name="connection.username">sa</property>
11 11  <property name="connection.password"></property>
12 12  <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
13 13  <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
14 -{code}
14 +{{/code}}
15 15  
16 -where <tt>\[DATABASE_LOCATION\]</tt> is where you wish to put the HSQL database. For example <tt>/apps/xwiki-database/xwiki</tt>.
16 +where ##[DATABASE_LOCATION]## is where you wish to put the HSQL database. For example ##/apps/xwiki-database/xwiki##.
17 17  
18 -1.1 Other optional ideas
18 +== Other optional ideas ==
19 19  
20 -* You can use a remote HSQLDB database instead of embedding it. To do this, just use a URL like <tt>jdbc:hsqldb:hsql:HOSTNAME...</tt> instead of the <tt>jdbcc:hsqldb:file:..</tt> URL. The major version of the hsqldb jar file must match the major version that the HSQLDB server is using.
20 +{{velocity filter="none"}}
21 +{{html clean="false" wiki="true"}}
22 +* You can use a remote HSQLDB database instead of embedding it. To do this, just use a URL like ##jdbc:hsqldb:hsql:HOSTNAME...## instead of the ##jdbcc:hsqldb:file:..## URL. The major version of the hsqldb jar file must match the major version that the HSQLDB server is using.
21 21  * If you want to use your app server facilities to manage your data sources (generally a better strategy), then
22 -** Put the <tt>hsqldb*.jar</tt> file into your app server class path instead of in your web app (like in <tt>$CATALINA_HOME/common/lib</tt>).
23 -** In <tt>hibernate.cfg.xml</tt>, use the following settings in place of the HSQLDB block in the sample file. Specifically, you do not set url, user, etc, here, and leave the provider_class unset (i.e. use the default vlaue), since XWiki's implementation does not handle container-managed data sources.
24 -{code}
24 +** Put the ##hsqldb*.jar## file into your app server class path instead of in your web app (like in ##$CATALINA_HOME/common/lib##).
25 +** In ##hibernate.cfg.xml##, use the following settings in place of the HSQLDB block in the sample file. Specifically, you do not set url, user, etc, here, and leave the provider_class unset (i.e. use the default vlaue), since XWiki's implementation does not handle container-managed data sources.
26 +{{/html}}
27 +{{/velocity}}
28 +
29 +{{code}}
25 25  <property name="connection.datasource">java:/comp/env/jdbc/xwiki</property>
26 26  <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
27 -{code}
28 -** Then you manage the data source using app server facilities. With Tomcat, for example, you would map the ~~resource link~~ <tt>jcbc/xwikiDs</tt> to a container-managed data source using the Admin web app or by editing the file <tt>conf/Catalina/*/xwiki.xml</tt> (i.e. webapp-name + ".xml").
32 +{{/code}}
33 +
34 +*
35 +** Then you manage the data source using app server facilities. With Tomcat, for example, you would map the //resource link// ##jcbc/xwikiDs## to a container-managed data source using the Admin web app or by editing the file ##conf/Catalina/*/xwiki.xml## (i.e. webapp-name + ".xml").
XWiki.XWikiComments[1]
Author
... ... @@ -1,0 +1,1 @@
1 +xwiki:XWiki.OlivierBerger
Comment
... ... @@ -1,0 +1,1 @@
1 +You may need to set an absolute path in the [[DATABASE_LOCATION]] if that doesn't work with a relative location
Date
... ... @@ -1,0 +1,1 @@
1 +2010-01-06 19:17:55.0

Get Connected