For open source JDBC drivers, buildomatic is setup so that there will be a single default driver used. If you would like to use a driver other than the default driver, you can modify the buildomatic property files that control which JDBC driver is used as the default.
The buildomatic JDBC driver property files are setup to point to a specific driver jar. This allows for there to be multiple driver jar files in the same buildomatic/conf_source/db/<dbType>/jdbc folder. When the installation procedure is executed only the default driver jar is copied to your application server.
If you would like 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
In the buildomatic/conf_source/db/postgresql/jdbc folder there are the following driver files:
postgresql-9.2-1002.jdbc3.jar
postgresql-9.2-1002.jdbc4.jar
If, for instance, you would like to change the default driver used by PostgreSQL from type jdbc4 to jdbc3, you can make the following changes:
Edit your default_master.properties file:
<js-install>/buildomatic/default_master.properties
Uncomment and change:
# maven.jdbc.version=9.2-1002.jdbc4
To:
maven.jdbc.version=9.2-1002.jdbc3
When you next run a buildomatic command, such as deploy-webapp-ce, the jdbc3 driver will be copied to your application server.
MySQL Example
In the buildomatic/conf_source/db/mysql/jdbc folder there is the following driver file:
mariadb-java-client-1.1.2.jar
If, for instance, you would like to use a JDBC driver that is built and distributed by the MySQL project, such as mysql-connector-java-5.1.30-bin.jar, you will first need to download the driver from the MySQL Connector/J download location:
https://dev.mysql.com/downloads/connector/j/
Next, you would 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 6 and 7: | <tomcat>/lib |
JBoss 5 | <jboss>/server/default/lib |
GlassFish: | <glassfish>/domains/domain1/lib/ext |
Recommended Comments
There are no comments to display.