You can configure your connection to the database in one of two ways:
| • | Configure the connection during installation of JasperReports Server by configuring the external.jdbcDriverClass, external.jdbcUrl, external.dbUsername, and/or external.dbPassword properties before installation or upgrade. You can choose to encrypt any of the database connection parameters. This is the preferred method for setting the database connection parameters. See the TIBCO JasperReports Server Security Guide for more information. |
| • | If you have a JasperReports Server, you can configure the connection properties directly in your sample-applicationContext-externalAuth-db-mt.xml file. In this case, the properties, including the password, can't be encrypted. |
Setting Database Connection Parameters in default_master.properties
The preferred method for setting the database connection parameters is to configure the external.jdbcDriverClass, external.jdbcUrl, external.dbUsername and dbPassword properties in the default_master.properties file before installation or upgrade. In JasperReports Server 5.6 and later, the default configuration of the externalDataSource bean in sample-applicationContext-externalAuth-db-mt.xml uses context properties for the database connection properties:
To configure these properties using default_master.properties, follow these steps:
| 1. | Open default_master.properties in a text editor. |
| 2. | Locate and set the following properties for your LDAP server: |
| • | external.jdbcDriverClass property – The name of the JDBC driver class for your database. Make sure the driver jar library is available on the classpath; for example, you can place the jar in the lib directory of your application server or in the <js-webapp>/lib directory. |
| • | external.jdbcUrl property – The JDBC URL for your database server, including the hostname, port, and database you want to access. |
| • | external.dbUsername property – The username of your database administrator. |
| • | external.dbPassword property — The password of your database administrator. |
| 3. | You can choose to encrypt any of the LDAP connection parameters. |
The following example shows the syntax of the properties in the default_master.properties file:
external.jdbcDriverClass=com.mysql.jdbc.Driverexternal.jdbcUrl=jdbc:mysql://127.0.0.1:3306/external_sso_testexternal.dbUsername=usernameexternal.dbPassword=password[/code] |
To encrypt the password property, also set the following:
encrypt=truepropsToEncrypt=dbPassword,external.dbPassword[/code] |
See the TIBCO JasperReports Server Security Guide for more information on encrypting passwords using buildomatic.
Setting Database Connection Parameters Manually
| If you configured your database connection during JasperReports Server installation, don't set the parameters using externalDataSource. You can verify whether the parameters are set by looking at the default_master.properties file. |
To set the connection parameters for the external database server directly in the application context file, configure the externalDataSource helper bean as follows:
| 1. | In sample-applicationContext-externalAuth-db-mt.xml, locate the externalDataSource bean. |
| 2. | Specify the following information: |
| • | driverClassName property – The name of the JDBC driver class for your database. Make sure the driver jar library is available on the classpath. For example, you can place the jar in the lib directory of your application server or in the <js-webapp>/lib directory. |
| • | url property – The JDBC URL for your database server, including the hostname, port, and database you want to access. |
| • | username property – The username of your database administrator. |
| • | password property – The password of your database administrator. |
The following is an example of the connection information for a MySQL database:
Recommended Comments
There are no comments to display.