Managing JDBC Drivers

To access a database from JasperReports Server using JDBC, you need an appropriate driver that is accessible in the server's classpath. The following drivers are installed by default:

MYSQL (org.mariadb.jdbc.Driver)
PostgreSQL (org.progresql.Driver)
Snowflake (net.snowflake.client.jdbc.SnowflakeDriver)
TIBCO® Data Virtualization (cs.jdbc.driver.CompositeDriver)

The Amazon S3 output location is not validated during Athena connector creation.

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.
Through the UI, if the setting is enabled in System Settings. As described in the following procedures, the system admin can add, replace, or remove JDBC drivers through the user interface, without needing to restart the server.

By default, no one can upload or update JAR files for JDBC drivers from the UI. Only the system administrator (superuser) can enable the setting and then manage the JDBC drivers, but once uploaded, the JDBC drivers are available to all administrators who create data sources. For more information, see the following sections:

Enabling JDBC Driver Uploads
Adding a JDBC Driver
Updating a JDBC Driver

JasperReports Server includes a JDBC driver for ElasticSearch that is not enabled by default. For information on enabling the driver and its limitations, see Enabling the JDBC Driver for ElasticSearch Data Sources.

JasperReports Server also supports Trino. Trino drivers are not installed by default in JasperReports Server. Refer to Trino's JDBC driver documentation for more information. For instructions on uploading Trino drivers, see Adding a Trino JDBC Driver.

Enabling JDBC Driver Uploads

By default, no one can upload or modify JAR files for JDBC drivers from the UI. Only the system administrator (superuser) can enable the setting and then manage the JDBC drivers, but once uploaded, the JDBC drivers are available to all administrators who create data sources.

To enable this setting

    Procedure
  1. Select Manage > Server Settings and choose General from the left-hand panel.
  2. Turn on the switch to allow uploading and updating JAR files for JDBC drivers.

For more information, see the following sections:

Adding a JDBC Driver
Updating a JDBC Driver

After uploading a JDBC driver, Jaspersoft recommends disabling driver uploads again for security reasons. This avoids the risk of drivers being accidentally modified or malicious JAR files being uploaded.

Adding a JDBC Driver

    Procedure
  1. Log in as the system administrator (superuser).
  2. Enable JDBC driver uploads, as described in Enabling JDBC Driver Uploads.
  3. Select View > Repository, right-click a folder's name, and select Add Resource > Data Source from the context menu. Alternatively, you can select Create > Data Source from the main menu on any page.
  4. In the Type field, select JDBC Data Source. The page refreshes to show the fields necessary for a JDBC data source.
  5. The dropdown selector for the JDBC Driver field shows the available JDBC drivers and those that are not installed.

Figure 37: Viewing the List of Available JDBC Drivers

  1. Select the driver that has not been installed, then click Select Driver. The Select Driver dialog appears.
  2. If you have not yet obtained the driver, click the link to Jaspersoft's community website for Downloading and Installing Database Drivers. That page 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.

Figure 38: Adding a JDBC Driver

  1. 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.
  2. 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 JDBC driver, you can install it as a new driver as described in the JasperReports Server Installation Guide.

Adding a Trino JDBC Driver

    Procedure
  1. Log in as the system administrator (superuser).
  2. Enable JDBC driver uploads, as described in Enabling JDBC Driver Uploads.
  3. Select View > Repository, right-click a folder's name, and select Add Resource > Data Source from the context menu. Alternatively, you can select Create > Data Source from the main menu on any page.
  4. In the Type field, select JDBC Data Source. The page refreshes to show the fields necessary for a JDBC data source.
  5. The dropdown selector for the JDBC Driver field shows the available JDBC drivers and those that are not installed.
  6. Select Other, then specify the JDBC Driver (required) as io.trino.jdbc.TrinoDriver.
  7. Click Select Driver. The Select Driver dialog appears.
  8. In the Select Driver dialog, click Browse to locate the appropriate driver JAR file.
  9. Click Upload to install the driver and make it available immediately.

Updating a JDBC Driver

    Procedure
  1. Log in as the system administrator (superuser).
  2. Enable JDBC driver uploads, as described in Enabling JDBC Driver Uploads.
  3. Select View > Repository, right-click a folder's name, and select Add Resource > Data Source from the context menu. Alternatively, you can select Create > Data Source from the main menu on any page.
  4. In the Type field, select JDBC Data Source. The page refreshes to show the fields necessary for a JDBC data source.
  5. The dropdown selector for the JDBC Driver field shows the available JDBC drivers and those that are not installed.
  6. To update a driver that has already been installed, select it from the list, then click Select Driver. The Select Driver dialog appears and notifies you that selecting a driver will overwrite the existing one.

Figure 39: Updating a JDBC Driver

  1. In the Select Driver dialog, click Browse to locate the JAR file for the new driver.
  2. Click Upload to replace the existing driver and make it available immediately.
  3. You can now use this driver to create a data source, and the driver will be installed when other administrators create data sources.

Removing an Uploaded JDBC Driver

    Procedure
  1. Log in as the system administrator (superuser).
  2. Select Manage > Server Settings and choose Restore Defaults from the left-hand panel.
  3. Locate the driver you uploaded in the list of properties. The drivers with the value [SYSTEM] are the default drivers configured at installation time. Do not remove the [SYSTEM] drivers.
  4. Click beside the driver that you want to remove, then confirm your choice.

Figure 40: Removing an Uploaded JDBC Driver

  1. Click Save to save your changes.

If the JDBC driver you remove is one that updated a default driver, the default driver will reappear as an installed driver the next time you use the New Data Source wizard.