Hide last authors
Manuel Smeria 4.2 1 * Derby in Embedded mode is a very simple database to configure as you don't need to install nor start it before being able to use it. It comes as a single JAR file named ##derby*.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 [[Derby web site>>http://db.apache.org/derby/]] or directly from the [[Maven Central Repository>>http://repo1.maven.org/maven2/org/apache/derby/derby/]].
Vincent Massol 5.1 2 * Once this is done, you need to configure XWiki to use Derby 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:(((
Manuel Smeria 4.1 3 {{code}}
Vincent Massol 1.1 4 <property name="connection.url">jdbc:derby:[DATABASE_LOCATION];create=true</property>
5 <property name="connection.driver_class">org.apache.derby.jdbc.EmbeddedDriver</property>
6 <property name="dialect">org.hibernate.dialect.DerbyDialect</property>
Manuel Smeria 4.1 7 {{/code}}
Vincent Massol 1.1 8
Manuel Smeria 4.2 9 where //[DATABASE_LOCATION]// is where you wish to put the Derby database (for example ///apps/xwikidb//).
Vincent Massol 1.1 10
Manuel Smeria 4.1 11 {{info}}
12 You don't need to specify a username/password property as by default Derby doesn't require them.
13 {{/info}}
Vincent Massol 5.1 14 )))Derby doesn't support VARCHAR larger than 32K and Hibernate doesn't map large fields to correct Derby types ([[it should use BLOB and CLOB instead of VARCHAR>>https://hibernate.onjira.com/browse/HHH-2651]]). Thus we need to provide a modified HBM mapping file. Follow the instructions below:
Vincent Massol 1.1 15
Manuel Smeria 4.2 16 = For XWiki 1.1M2 and above =
Vincent Massol 1.1 17
Manuel Smeria 4.2 18 Use the following mapping definition in //WEB-INF/hibernate.cfg.xml//: {{code}}<mapping resource="xwiki.derby.hbm.xml"/>{{/code}}. This definition should replace any other similar definition (except for the ##feeds.hbm.xml## definition which is used for something else).

Get Connected