To access a database from JasperReports Server using JDBC you need an appropriate driver that's accessible in the server’s classpath. In JasperReports Server 5.6.1, the following drivers are installed by default:
| • | MySQL (org.mariadb.jdbc.Driver) |
| • | PostgreSQL (org.postgresql.Driver) |
| • | Oracle (tibcosoftware.jdbc.oracle.OracleDriver) |
| • | Microsoft SQL Server (tibcosoftware.jdbc.sqlserver.SQLServerDriver) |
| • | IBM DB2 (tibcosoftware.jdbc.db2.DB2Driver) |
| • | Hive (tibcosoftware.jdbc.hive.HiveDriver) |
Drivers for other databases can be downloaded from links on the Jaspersoft community website:
http://community.jaspersoft.com/wiki/downloading-and-installing-database-drivers
The system administrator (superuser) can add JDBC drivers for other databases in the following ways:
| • | During installation. For more information, see the JasperReports Server Installation Guide. |
| • | At any time through the UI. As described in the procedure below, the system admin can add, replace, or remove JDBC drivers through the user interface, without needing to restart the server. |
Only the system administrator can manage the JDBC drivers, but once uploaded, they're available to all administrators who create data sources.
| JBoss doesn't lacks the flexibility of uploading drivers on the fly. On JBoss, drivers that are not installed don't appear in the list below, and you must configure and restart JBoss to add a driver. For more information, see JDBC Drivers on JBoss. |
To add a JDBC driver:
| 1. | Log on as the system administrator (superuser on commercial editions, jasperadmin on community editions). |
| 2. | Select Create > Data Source from the main menu. |
| 3. | In the Type field, select JDBC Data Source. The page refreshes to show the fields necessary for a JDBC data source. |
| 4. | The dropdown selector for the JDBC Driver field shows the available JDBC drivers and those that are not installed. |
|
Viewing the List of Available JDBC Drivers |
| 5. | If you want to add a driver that has not been installed, select it from the list, then click Add Driver. The Select Driver dialog appears. |
| 6. | If you have not yet obtained the driver, click the link for Downloading and Installing Database Drivers. That page on Jaspersoft's community website has links to the most commonly used JDBC drivers. After you download a driver to your file system, you can return to the Select Driver dialog. |
|
Adding a JDBC Driver |
| 7. | In the Select Driver dialog, click Browse to locate the appropriate driver JAR file. If your driver has more than one JAR file, click the Browse button that appears after selecting the first file. |
| 8. | Click Upload to install the driver and make it available immediately. |
You can replace any driver that you upload with newer versions of the same driver. If you want to use the vendor's own driver instead of the TIBCO JDBC driver, you can install it as a new driver as described in the JasperReports Server Installation Guide.
To update a JDBC driver:
| 1. | Log on as the system administrator (superuser on commercial editions, jasperadmin on community editions). |
| 2. | Select Create > Data Source from the main menu. |
| 3. | In the Type field, select JDBC Data Source. The page refreshes to show the fields necessary for a JDBC data source. |
| 4. | The dropdown selector for the JDBC Driver field shows the available JDBC drivers and those that are not installed. |
| 5. | To update a driver that has already been installed, select it from the list, then click Edit Driver. The Select Driver dialog appears and notifies you that selecting a driver will overwrite the existing one. |
|
Updating a JDBC Driver |
| 6. | In the Select Driver dialog, click Browse to locate the new driver JAR file. |
| 7. | Click Upload to replace the existing driver and make it available immediately. |
| 8. | You can now use this driver to create a data source, and the driver will be installed when other administrators create data sources. |
To remove an uploaded JDBC driver:
| 1. | Log on as the system administrator (superuser on commercial editions, jasperadmin on community editions). |
| 2. | Select View > Repository and open the System Properties folder at the root. |
| 3. | Right click the GlobalPropertiesList resource and select Edit from the context menu. |
| 4. | Locate the driver you uploaded in the list of properties. The drivers with the value [sYSTEM] are the default drivers configured at installation time. |
| 5. | Click Remove beside the driver you want to remove. |
|
Removing an Uploaded JDBC Driver |
| 6. | Click Submit to save your changes. |
| If the JDBC driver you remove is one that updated a default driver, the default driver will reappear as a [sYSTEM] driver in the GlobalPropertiesList the next time you use the New Data Source wizard. |
Recommended Comments
There are no comments to display.