This section describes how to set up your installation to use a driver other than the default driver.
Open Source JDBC Drivers
For open source JDBC drivers, buildomatic is set up to use a single default driver. If you want to use a driver other than the default driver, you can modify the buildomatic property files that determine the default JDBC driver.
The buildomatic JDBC driver property files are set up to point to a specific driver jar. This allows for multiple driver jar files in the same buildomatic/conf_source/db/<dbType>/jdbc folder. During the installation procedure only the default driver jar is copied to your application server.
If you want to use a newer JDBC driver version or a different JDBC driver, you can modify the buildomatic properties seen in your default_master.properties file.
PostgreSQL Example
The buildomatic/conf_source/db/postgresql/jdbc folder contains these driver files:
postgresql-42.2.5.jar
For instance, to change the default driver used by PostgreSQL from type jdbc4.2 to jdbc4.1:
1. | Download postgresql-42.2.5.jre7 from https://jdbc.postgresql.org/download.html and save it under buildomatic/conf_source/db/postgresql/jdbc. |
2. | Edit your default_master.properties file, <js-install>Edit your default_master.properties file, <js-install>/buildomatic/default_master.properties as follows: follows: |
Uncomment and change:
# maven.jdbc.version=42.2.5
To:
maven.jdbc.version42.2.5.jre7
When you next run a buildomatic command, such as deploy-webapp-ce, the jdbc4.1 driver will be copied to your application server.
MySQL Example
The buildomatic/conf_source/db/mysql/jdbc folder contains this driver file:
mariadb-java-client-2.5.3.jar
If, for instance, you want to use a JDBC driver built and distributed by the MySQL project, such as mysql-connector-java-8.0.20-bin.jar, you first need to download the driver from the MySQL Connector/J download location:
https://dev.mysql.com/downloads/connector/j/
Next, change your buildomatic configuration properties to point to this new driver.
Edit your default_master.properties file:
<js-install>/buildomatic/default_master.properties
Uncomment and change:
# jdbcDriverClass=com.mysql.jdbc.Driver
# maven.jdbc.groupId=mysql
# maven.jdbc.artifactId=mysql-connector-java
# maven.jdbc.version=5.1.30-bin
To:
jdbcDriverClass=com.mysql.jdbc.Driver
maven.jdbc.groupId=mysql
maven.jdbc.artifactId=mysql-connector-java
maven.jdbc.version=5.1.30-bin
Application Server Copy-to Locations
When the deploy-webapp-ce buildomatic target is executed it copies the JDBC driver to the following default locations:
Tomcat: | <tomcat>/lib |
JBoss: | <jboss>/standalone/deployments |
Wildfly: | <wildfly>/standalone/deployments |
Recommended Comments
There are no comments to display.