Previous Page Next Page
Configuring in a Standalone Environment
Configuring via server UI
Configuring in dbconfig.xml
This document presents the two ways of configuring the server database in a standalone environment: via the JReport Server UI, or using the configuration file dbconfig.xml.
Configuring via server UI
- In the JReport Server console, point to Administration on the system toolbar, and then click Configuration > Server DB > System DB/Realm DB/Profiling DB from the drop-down menu to open the corresponding page.
- Select a realm if you are configuring the realm or profiling database from the Select Realm drop-down list at the top right corner.
- In the Configuration tab, select a database driver from the Driver drop-down list.

For MS SQL Server 2005 and later versions, select the driver com.microsoft.sqlserver.jdbc.SQLServerDriver from the drop-down list; select com.microsoft.jdbc.sqlserver.SQLServerDriver for versions earlier than MS SQL Server 2005.
- In the Driver Class Location text field, type or click the Browse button to specify the location for the driver class.
For the HSQLDB and Derby databases, you do not need to specify the driver class location. For all other databases, you will have to provide the driver class path information unless it has already been added to the class path during installation or by editing the setenv.bat file (setenv.sh on Unix) in <install_root>\bin
.
- Type a valid URL that can be used to establish a connection to the database. The valid format of the URL should be provided by the driver vendor.
- Provide the user ID and password.
- To test the connection, click Test. To update the database configuration and to apply the settings, click Update and then restart the server to finalize the function. All previously published reports and all other information on users, groups and roles will be lost when you restart.
Configuring in dbconfig.xml
You can configure the server database in dbconfig.xml located in <install_root>\bin
using either of the following two methods. Note that in dbconfig.xml, <database name
> must be JReport Server's inner database name: systemtables for the system database, realmtables for the realm database, or profile for the profiling database.
Method 1: Specifying the URL, driver, user and password respectively
<database name="systemtables/realmtables/profile">
<url>...</url>
<driver>...</driver>
<user>...</user>
<password>...</password>
</database>
|
The configuration via this method can also be modified in the server console.
Below are three examples for your reference:
- The following example is for connecting to an Oracle database.
<?xml version="1.0" encoding="UTF-8"?> <dbconfig> <workspace name="systemRealm"> <database name="systemtables"> <url>jdbc:oracle:thin:@dbhost:1521:SystemDB</url> <user>test</user>
<password>1234</password>
<driver>oracle.jdbc.OracleDriver</driver> </database> </workspace> <workspace name="defaultRealm"> <database name="realmtables"> <url>jdbc:oracle:thin:@dbhost:1521:RealmDB</url> <user>test</user>
<password>1234</password>
<driver>oracle.jdbc.OracleDriver</driver> </database> </workspace> </dbconfig>
|
- The following example is for using the DataDirect driver to connect to a MS SQL Server database.
<?xml version="1.0" encoding="UTF-8"?>
<dbconfig>
<workspace name="systemRealm"> <database name="systemtables">
<url>
jdbc:datadirect:sqlserver://dbhost:1433;DatabaseName=SystemDB
</url>
<user>test</user>
<password>1234</password>
<driver>
com.ddtek.jdbc.sqlserver.SQLServerDriver
</driver>
<dbtype>Microsoft SQLServer</dbtype>
</database>
</workspace>
<workspace name="defaultRealm">
<database name="realmtables">
<url>
jdbc:datadirect:sqlserver://dbhost:1433;DatabaseName=RealmDB
</url>
<user>test</user>
<password>1234</password>
<driver>
com.ddtek.jdbc.sqlserver.SQLServerDriver
</driver>
<dbtype>Microsoft SQLServer</dbtype>
</database>
</workspace>
</dbconfig>
|
- The following example is for connecting to an InterSystems Caché database.
<?xml version="1.0" encoding="UTF-8"?>
<dbconfig>
<workspace name="systemRealm"> <database name="systemtables">
<url>jdbc:Cache://IP:1974/SAMPLES</url>
<user>test</user>
<password>1234</password>
<driver>com.intersys.jdbc.CacheDriver</driver>
</database>
</workspace>
<workspace name="defaultRealm">
<database name="realmtables">
<url>jdbc:Cache://IP:1974/SAMPLES</url>
<user>test</user>
<password>1234</password>
<driver>com.intersys.jdbc.CacheDriver</driver>
</database>
<database name="profile">
<url>jdbc:Cache://IP:1974/SAMPLES</url>
<user>test</user>
<password>1234</password>
<driver>com.intersys.jdbc.CacheDriver</driver>
</database>
</workspace>
</dbconfig>
|
Method 2: Specifying a JDBC data source using the <datasource></datasource>
tags
The URL format of a JDBC data source is:
jdbc://[<jdbc-user:jdbc-password>@]<jdbc-url>[#<attribute-name=attribute-value>,]
For example:
<database name="systemtables/realmtables/profile">
<datasource>
jdbc://user:password@jdbc:odbc:jreport-realmtables#driver=sun.jdbc.odbc.JdbcOdbcDriver
</datasource>
</database>
|
Notes:
-
The <user>
and <password>
information is encrypted. They will be replaced by the <encrypt-sign>
tag after JReport Server starts up as follows:
<encrypt-sign>enDkq7srM9cHhoUwzYXJ3NvcDIYk</encrypt-sign>
If you want to change user or password, delete the <encrypt-sign>
tag and add the <user> and <password>
tags in dbconfig.xml.
- For MySQL 5.0.xx, the letters in user name should all be lowercase.
- Because of the compatibility between the third party package Quartz used by JReport Server and the driver of Oracle database, the Quartz package will throw an exception when the class path of the Oracle database driver is added into dbconfig.xml. To avoid this problem, when JReport Server works with an Oracle database, do not set the database driver class path in dbconfig.xml.
Previous Page Next Page