Chapter 30. Prepare the Derby Database for the Tigase Server

Table of Contents

Basic Setup
General Approach

Wojciech Kapcia <wojciech.kapcia@tigase.org> v2.0, June 2014: Reformatted for AsciiDoc. :toc: :numbered: :website: http://tigase.net :Date: 2012-06-21 13:28

This guide describes how to prepare the Derby database for connecting the Tigase server to it.

Basic Setup

Preparation of the Derby database is quite simple, but the following assumptions are made

  • DerbyDB - Derby database name
  • database/ directory contains all necessary schema files
  • jars/ and libs/ directories contains Tigase and Derby binaries

General Approach

From the main Tigase directory execute following commands (Linux and Windows accordingly)

java -Dij.protocol=jdbc:derby: -Dij.database="DerbyDB;create=true" -cp libs/derby.jar:libs/derbytools.jar:jars/tigase-server.jar org.apache.derby.tools.ij database/derby-schema-5.1.sql
java -Dij.protocol=jdbc:derby: -Dij.database="DerbyDB;create=true" -cp libs\derby.jar;libs\derbytools.jar;jars\tigase-server.jar org.apache.derby.tools.ij "database\derby-schema-5-1.sql"

This will create Derby database named DerbyDB in the main Tigase directory and load Tigase schema for the version 5.1.

If there is a need to create schema for any other Tigase version then please use schema relevant to the version that you intend to use:

If you run the Tigase server all versions below 4.0:

derby-schema-3.sql

For the Tigase server version 4.x and later:

derby-schema-4.sql

For the Tigase server version 5.0 and later:

derby-schema-5.sql

For the Tigase server version 5.1 and later:

derby-schema-5-1.sql