Supported Databases :: GBIF IPT User Manual (original) (raw)

If you run the IPT within a servlet container (like Tomcat), you can add your own JDBC drivers to the IPT. This allows you to support a different database, or to change the connection settings for one of the existing database types.

The following steps assume you have a working IPT installed with an "exploded" WAR, i.e. you have a folder ipt (or however you named your instance) in your application server’s webapps folder. The IPT needs to be stopped before you start adding a driver.

Add JDBC driver JAR to classpath

You need to copy this JAR into the classpath of your webapp. The simplest is to copy it to the ipt/WEB-INF/lib directory.

Modify jdbc.properties

In order for the IPT to understand which drivers are available and how to construct the JDBC URL for it, we maintain a simple properties file with all the information. Open ipt/WEB-INF/classes/jdbc.properties and inspect the existing entries, for example for PostgreSQL:

PostgreSQL driver

pgsql.title=PostgreSQL pgsql.driver=org.postgresql.Driver pgsql.url=jdbc:postgresql://{host}/{database} pgsql.limitType=LIMIT

There are 4 properties that you need to add for each driver. All 4 have to start with the same prefix that you can freely choose without any further meaning:

In the PostgreSQL example above, and with reference to the PostgreSQL driver documentation, the following change would enable an encrypted connection:

pgsql.url=jdbc:postgresql://{host}/{database}?sslmode=require

The following example is for an SQLite driver. This connects to a file, so no {host} is used in the URL template:

SQLite driver

uses files only, so {host} is ignored

database example on Windows: C:/work/mydatabase.db

database example on Linux: /home/leo/work/mydatabase.db

sqlite.title=SQLite sqlite.driver=org.sqlite.JDBC sqlite.url=jdbc:sqlite:{database} sqlite.limitType=LIMIT

Now you can restart the IPT and use the new driver for mapping SQLite data sources.