JDBC data sources are direct connections to your database managed by JasperReports Server. To create one, you must provide the URL and credentials to access your database, along with any database-specific configuration parameters.
JasperReports Server includes JDBC drivers for the most used some databases. If your data base is not included, or if you want to use different JDBC drivers, the system administrator must upload the appropriate JDBC driver before creating a data source. For more information on JDBC drivers, see Managing JDBC Drivers.
To create a JDBC data source:
| 1. | Log on as an administrator. |
| 2. | Click 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 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 required for a JDBC data source. |
| 4. | 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 Managing JDBC Drivers. |
![note-icon-ns_28x28.png.d6971503f71fdd2f18b6747869627d8a.png](https://community.jaspersoft.com/applications/core/interface/js/spacer.png) | TIBCO provides a set of JDBC drivers in the installed server. These drivers support a slightly different SQL syntax. If you see errors when running reports or creating domains that use scalar functions, see SQL Functions with TIBCO JDBC Drivers. |
| 5. | Enter the hostname, port, and database name for your database. The default hostname is 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 where the server will access the database. When specifying values for your JDBC data source: |
| • | The JDBC URLs for some databases allow optional parameters described in JDBC Database URLs. |
![js-DataSource-JDBC-type.png.6b275e2d80e64d34013dcb4bba19d3c1.png](https://community.jaspersoft.com/applications/core/interface/js/spacer.png) |
Setting the JDBC Data Source Type |
| 6. | Fill in the database user name and password. These are the credentials the server will use to access the database. |
![note-icon-ns_28x28.png.db8921cd28613847376fbb4e4852a1f3.png](https://community.jaspersoft.com/applications/core/interface/js/spacer.png) | Set the Time Zone field when the date-time values stored in your database 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 database. The list of time zones is configurable, as described in Specifying Additional Time Zones. When in doubt, leave the Time Zone field blank. |
| 7. | 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 section Logging JDBC Operations. |
![js-DataSource-JDBC-testConnection.png.7e8a6de3a9d31a9cd88a0f5e3a5f71b8.png](https://community.jaspersoft.com/applications/core/interface/js/spacer.png) |
Entering the User Name and Password |
| 8. | When the test is successful, click Save. The Save dialog appears. |
![js-DataSource-JDBC-save.png.a0b4f56597e72adc0fcd53501b8b90aa.png](https://community.jaspersoft.com/applications/core/interface/js/spacer.png) |
Saving the JDBC Data Source |
| 9. | Enter a name for the data source and an optional description. The Resource ID is generated from the name you enter. If you haven't already specified a location, expand the folder tree and select the location for your data source. |
| 10. | Click Save in the dialog. The data source appears in the repository. |
Recommended Comments
There are no comments to display.