I. Overview
1. Version
Finereport version | Function changes |
---|---|
10.0.16 | The designer data connection configuration changes from the original direct input URL to the format of "Database Name + Host + Port". Keep the URL format and realize two-way linkage with configuration items to reduce the difficulty of data connection configuration. |
2. Function introduction
FineReport provides two data connection methods:
Method 1: Connect in the decision-making platform, refer to: Configure Data Connection
Method 2: Connect in the designer. This article mainly introduces this method.
II. JDBC data connection
1. Database type is in the drop-down box
This chapter takes MySQL database as an example to introduce the steps of JDBC data connection.
1) Click "Server>Define Data Connection" in designer, click the "" button in the upper left corner to create a new database, and select "JDBC" to connect, as shown in the figure below:
2) Drop down and select the database type as "MySQL", the "Driver" and the default "URL" will be auto loaded, as shown in the figure below:
3) Fill in "Host", "Port", and "Database Name" according to the actual database address information, and the corresponding URL will be automatically generated. Entering the URL will also automatically fill in the above information. And remember to fill in "Username" and "Password", as shown in the figure below:
The description of each configuration item is shown in the following table:
Setting items | Description |
---|---|
Data connection name | You can double-click the data connection name on the left to modify it. |
Connection pool attributes | Generally use default settings |
Encoding | You can refer to: Coding, generally use the default settings |
4) Click "Test Connection" in the upper left corner, the "Successfully Connected" window will pop up, and the MySQL database connection is successful, click OK. As shown below:
Note: A successful test connection does not mean that the data in the database can be obtained correctly, but only the network connection is tested.
2. Database type is not in the drop-down box
If the database to be connected is not in the drop-down box, you can select Others. This chapter takes FireBird data connection as an example.
1) Download the driver, refer to: Configuration Information.
2) In the designer, click "Server> Define Data Connection", click button in the upper left corner to create a new database, and select JDBC connection, as shown in the figure below:
3) Select the database type as Others, as shown in the figure below:
4) Fill in the corresponding driver and URL (database supported in the designer and the corresponding connection attribute value), as shown in the figure below:
Note: For the description of each configuration item, please refer to the description in the table below Chapter II.1 of this article.
5) Click "Test Connection" in the upper left corner, a "Successfully Connected" window will pop up, and the FireBird database connection is successful, click OK. As shown below:
III. Other situation
Oracle cluster database connection:
If you are using a cluster Oracle database, when configuring the data connection, the URL needs to be filled in in the following format:
jdbc:oracle:thin:@(description=(address_list= (address=(host=192.168.10.1) (protocol=tcp)(port=1521))(address=(host=192.168.10.2)(protocol=tcp) (port=1521))(load_balance=yes)(failover=yes))(connect_data=(service_name= orcl)))