Download Driver Jar from Vendor Website
To download a commercial JDBC driver for a particular vendor, you will need to go to the download website of that vendor. It is typical that these vendors will require you to register and login to their website before you can download driver packages. Additionally, it is standard for the vendor's website to present a terms of service agreement that will need to be agreed to. Here are some common URL addresses where you can find download packages for supported databases:
• | http://www.oracle.com/technetwork/indexes/downloads (Oracle) |
• | http://www.microsoft.com/en-us/download/details.aspx?id=11774 (SQL Server) |
• | http://www-01.ibm.com/software/data/db2/linux-unix-windows/downloads.html (DB2) |
Collect Driver Jar from Existing Application
It is very often the case that a JDBC driver is already present in an application that is running within your network. If this is the case, then it can be very convenient to collect a copy of that driver jar and copy it to the JasperReports Server install location.
Copy Driver Jar to Final Location
Once the JDBC driver has been downloaded or collected, it can be copied to the location where the JasperReports Server installation expects the Jar file to be. Here are the "copy to" locations for certified commercial databases:
• | <js-install>/buildomatic/conf_source/db/oracle/jdbc (Oracle) |
• | <js-install>/buildomatic/conf_source/db/sqlserver/jdbc (SQL Server) |
• | <js-install>/buildomatic/conf_source/db/db2/jdbc (DB2) |
When the JDBC jar is copied to the location shown above, the JasperReports Server installation procedure is ready to be started.
Changing the JDBC Driver Deployed by Buildomatic
JDBC drivers for databases are handled differently depending on whether the database is commercial or open source. For the commercial databases (Oracle, SQL Server, and DB2), JDBC drivers are not included in buildomatic. For open source databases (PostgreSQL and MySQL), JDBC drivers are pre-integrated into buildomatic.
Commercial JDBC Drivers
For commercial databases, buildomatic is setup so that the JDBC driver jar filename can be any filename as long as it ends with ".jar". The driver jar file is placed in the buildomatic location for your commercial database <js-install>/buildomatic/conf_source/db/<dbType>/jdbc.
However, it is important that you only put one driver jar file in this folder. As part of the installation procedure buildomatic will copy the contents of the jdbc folder to your application server. So, it is important that only one JDBC driver file is put in this folder. If two driver jars are used in your application server there can be unknown problems. Also, it will be possible to get a Java Class exception if the two driver jars cannot co-exist with each other.
Open Source JDBC Drivers
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-pro, 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-pro 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.