3.11. Changing the Default Database

3.11.1. MariaDB
3.11.2. Microsoft SQL-Server
3.11.3. MySQL
3.11.4. PostgreSQL

By default Klaros-Test­management uses the Apache Derby Database which requires no further installation or configuration but is severely lacking performance in comparison to other databases. For productive use, it is therefore strongly recommended to use a more powerful database system, such as the open source database servers PostgreSQL or MariaDB/MySQL or the commercial Microsoft SQLServer database product.

To switch to another database system, Klaros-Test­management must be stopped, and the file hibernate.properties located in <user.home>/.klaros/hibernate.properties must be edited as shown below.

The hibernate.connection.url property must match the location of the database in your network. Please consult your database administrator for the hibernate.connection.username and hibernate.connection.password credentials to use.

[Warning] Warning

Blank spaces at the end of lines in the hibernate.properties file might get misinterpreted by hibernate! For example, 'hibernate.connection.password=root ' is not the same as 'hibernate.connection.password=root' (ignoring quotes).

3.11.1. MariaDB

For MariaDB change the content of the file to:

MariaDB 10.3 or later:

hibernate.connection.driver_class=org.mariadb.jdbc.Driver
hibernate.connection.url=jdbc:mariadb://localhost:3306/klaros
hibernate.connection.username=root
hibernate.connection.password=root

3.11.2. Microsoft SQL-Server

To use a Microsoft SQL-Server change the content of the file to:

Microsoft SQL-Server 2008 or later Versions:

hibernate.connection.driver_class=com.microsoft.sqlserver.jdbc.SQLServerDriver
hibernate.connection.url=jdbc:sqlserver://localhost:1433;databaseName=KLAROS
hibernate.connection.username=root
hibernate.connection.password=root

3.11.3. MySQL

For MySQL change the content of the file to:

MySQL 5.5 or later versions:

hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost:3306/klaros
hibernate.connection.username=root
hibernate.connection.password=root
[Important] Important

When using a MySQL database, it is important to set the following option in the my.ini file.

# The maximum size of a query packet the server can handle as well as
# maximum query size server can process (Important when working with
# large BLOBs).  enlarged dynamically, for each connection.
max_allowed_packet = 64M

3.11.4. PostgreSQL

To use PostgreSQL change the content of the file to:

PostgreSQL 9.4 or later versions:

hibernate.connection.driver_class = org.postgresql.Driver
hibernate.connection.url = jdbc:postgresql://localhost/klaros
hibernate.connection.username=root
hibernate.connection.password=root

An exhaustive list of all parameters can be found in the Hibernate Core Manual.

[Tip] Creating a Database Instance

Klaros-Test­management will not automatically create either the database instance ( klaros in the above example) or the database user (user root with password root in the above example) in the database server.

Creating a database instance and adding a user is described in the corresponding database manual and will not be covered here. The database user needs permissions to create, drop and alter tables to properly bootstrap the Klaros-Test­management database instance.

[Tip] Make sure to activate support for UTF-8 Character Sets!

Depending on your database product it may be needed to manually activate support for UTF-8 character sets, which may be needed to support languages with uncommon character sets. Especially MySQL is known for coming with a limited character support in its default configuration. The following example shows how to activate this by editing the mysql.cnf configuration file.

character-set-server=utf8
collation-server=utf8_general_ci

Example 3.2. Additional entries in mysql.cnf to support UTF-8 Character Sets


To switch back to the integrated Derby database:

hibernate.connection.driver_class=org.apache.derby.jdbc.EmbeddedDriver
hibernate.connection.url=jdbc\:derby\:${user.home}/.klaros/klarosDerby;create\=true
hibernate.connection.username=root
hibernate.connection.password=root