Administrator's Guide > Installation and Configuration > Database Configuration

Database Configuration

A PTV xServer is delivered with a simple database (Apache Derby) to store points of interest (POI), traffic information, and jobs.

Alternative Databases

Other databases can be used as well, as long as there is a jdbc driver in the top level folder jdbc.

The JDBC driver for Microsoft SQL Server is, for example, named mssql-jdbc-*.jre8.jar. To use this database put the driver into the jdbc folder, adjust the job-management-db.xml file in the conf folder as follows:

        <property name="dataSourceProperties">
            <props>
                <prop key="url">jdbc:sqlserver://<hostname>:<port>;databaseName=<database name></prop>
                <prop key="user"><user name></prop>
                <prop key="password"><password></prop>
            </props>
        </property>
        

Depending on the database it is also necessary to adapt the property connectionTestQuery in the files job-management-db.xml and datasource-template.xml.

Configuration File

The base configuration file is called <configuration>-geodatasource.xml. In the file default-geodatasource.xml, there is an XML element Datasource with attributes driver, url, user, and password. These attributes have to be configured, examples are provided below:

Apache Derby (this is the default configuration)
<Datasource driver="org.apache.derby.jdbc.ClientDriver" 
url="jdbc:derby://localhost:50036/poi" user="POI" password="POI" />
Oracle Database
<Datasource driver="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin://<ORACLE_HOST>:1521/<DATABASE_NAME>" user="USER" password="PASSWORD" />
Microsoft SQL Server
<Datasource driver="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://<MS_SQL_HOST>:1433/<DATABASE_NAME>" 
user="USER" password="PASSWORD" />

Hint: If there is no verifiable server certificate you should add the parameter trustServerCertificate=true to the JDBC URL.

Links to jdbc driver providers

  • H2 Database Engine
  • MariaDB
  • Microsoft SQL Server
  • MySQL
  • Oracle Database
  • PostgreSQL
  •