Before you create a JDBC data source, the JDBC driver for your data base must be configured in JasperReports Server by a system administrator. For more information on JDBC drivers, see JDBC Data Sources.
To create a JDBC data source:
| 1. | Log on as an administrator. |
| 2. | Click View > Repository, expand the folder tree, and right-click a folder to select Add Resource > Data Source from the context menu. Alternatively, you can select Create > Data Source from the main menu on any page and specify a folder location later. If you installed the sample data, the suggested folder is Data Sources. |
The New Data Source page appears.
| 3. | In the Type field, select JDBC Data Source. |
The page refreshes to show the fields necessary for a JDBC data source.
| 4. | Enter a name and optional description for the data source. The resource ID is filled in automatically based on the name. |
|
Setting the JDBC Data Source Type |
| 5. | Select the JDBC driver for your database. If your driver is listed as NOT INSTALLED, a system administrator must first upload the driver as described in JDBC Data Sources. |
|
Setting the JDBC Driver |
| 6. | Enter the hostname, port, and database name for your database. The default hostname is the localhost, and the default port is the typical port for the specified database vendor. The three fields are combined automatically to create the JDBC URL that the server will use to access the database. |
For more information about JDBC URLs, including optional parameters, see the troubleshooting JDBC Database URLs.
| 7. | Fill in the database user name and password. These are the credentials that the server will use to access the database. |
|
Testing the JDBC Connection |
| Set the Time Zone field when the date-time values stored in the target RDBMS do not indicate a time zone. When date-time values are stored in a format other than local time zone offset relative to Greenwich Mean time (GMT), you must specify a time zone so that the server can properly convert date-time values read from the target database. Set the Time Zone field to the correct time zone for the data in the data base. When in doubt, leave the Time Zone field blank. The list of time zones is configurable, as described in appendix section Specifying Additional Time Zones. |
| 8. | Click Test Connection to validate the data source. If the validation fails, ensure that the values you entered are correct and that the database is running. To diagnose JDBC connection issues, you can turn on logging as described in the troubleshooting JDBC Database URLs. |
| 9. | When the test is successful, click Save. The data source appears in the repository. |
Recommended Comments
There are no comments to display.