Overview
Version
FineReport Server Version | Functional Changes |
11.0.1 | Added the Driver Management function. |
11.0.5 | Not allowed to upload the driver package through Driver Management. Used the SystemConfig.driverUpload parameter to control whether to allow uploading new drivers. |
11.0.24 | Added the Driver Loading Order configuration item. |
Application Scenario
You may fail to connect to FineReport or the database due to the lack of the built-in database driver of the corresponding version.
Function Description
You can use the Driver Management function to upload the corresponding driver. Driver Management supports hot swapping, which allows you to use the driver after uploading it without restarting FineReport.
If a driver is problematic, you can quickly modify the driver-loading method to ensure a fast connection. By default, Load and Upload Driver Preferentially via Current Method is selected, as shown in the following figure.
Load and Upload Driver Preferentially via Current Method refers to loading the JAR file in WEB-INF/drivers/hive first. If no such file exists, it will load the JAR file in WEB-INF/lib.
Load and Upload Driver Only via Current Method refers to only loading the JAR file in WEB-INF/drivers/hive.
Preconditions
FineReport prohibits uploading drivers through Driver Management by default due to the high requirements of most users for project security.
Therefore, before using the Driver Management function, you need to set the SystemConfig.driverUpload parameter in the fine_conf_entity table of the FineDB database that stores FineReport information to true.
Change the parameter value to true: You are allowed to upload the driver package through Driver Management. For details about the procedures, see the following sections.
Change the parameter value to false (default value): You are not allowed to upload the driver package through Driver Management. The following error occurs during uploading. The driver is not allowed to be uploaded. You can modify the value of SystemConfig.driverUpload to enable this function.
Creating a Data Connection
Log in to the decision-making platform as the admin and choose System Management > System Setting > General.
If the External Database is to be configured, you can obtain the FineDB database information referring to FineDB Database Introduction.
If the External Database is configured, you can click it to view the information of the external FineDB database.
Create a data connection named FineDB and fill in the obtained database information.
Updating the Field Through Data Entry
Connect the designer to the project remotely and preview the template finedb field modification.cpt.finedb field modification.cpt
1. If the SystemConfig.driverUpload field exists on the preview page, and the field value is true, the configuration is completed.
2. If the data on the page is empty, the SystemConfig.driverUpload field does not exist. You can click Add Record to create a record.
Enter SystemConfig.driverUpload as the ID and true as the value, and click Submit.
Restarting the Project
Restart the project after you have finished the above steps. Log in to the decision-making platform, and now you can upload the driver package through Driver Management.
Procedure
Uploading the Database Driver
Log in to the decision-making platform as the admin and choose System Management > Data Connection > Data Connection Management > Driver Management, as shown in the following figure.
Click New Driver and enter a name for easy differentiation from other drivers. Take uploading the PostgreSQL driver as an example. You can click Upload File to upload the driver package and name it postgresql driver, as shown in the following figure.
Click Upload File to upload the JAR package of the database driver.
Select the uploaded driver from the drop-down list of Driver, and click Save, as shown in the following figure.
1. If there are multiple JAR packages for a driver, and you are unsure which one to upload, ask the corresponding database administrator for help.
2. The uploaded driver JAR file is located at %FineReport%\webapps\webroot\WEB-INF\drivers.
Using Uploaded Database Driver
Click New Data Connection on the Data Connection Management page to create a PostgreSQL data connection, as shown in the following figure.
Select Custom and the uploaded PostgreSQL driver from the drop-down lists of Driver, and fill in the database information. For details, see PostgreSQL Data Connection.
Click Test Connection and you may find that the database is successfully connected, as shown in the following figure.
Deleting a Driver
To delete an existing database driver, you can go to the driver management page and click the delete button, as shown in the following figure.
Earlier Versions
The Driver Management function is not available in 11.0.1 and earlier versions, where you can upload driver packages manually.
Copy the downloaded driver and paste it to the %FR_HOME%\webapps\webroot\WEB-INF\lib directory, and the driver will take effect after you restart the report server.