Configuring the server database in a standalone environment

When JReport Server is running in a standalone environment, you can configure the database for it remotely on the JReport Administration page. Also, since the server database configuration information is stored in the dbconfig.xml file in the directory <install_root>\bin, you can also configure the server database in this file.

The following presents the two ways of configuring the server database in a standalone environment:

Configuring on the JReport Administration page

  1. Log onto the JReport Administration page, click Data on the system toolbar and then select System DB, Realm DB, or Profiling DB from the drop-down menu according to your requirement.

    Note: The Profiling DB option is not shown by default on the drop-down menu. In order to make it shown, you should set the server.profiling.enable property to true in the server.properties file in the <install_root>\bin directory.

  2. Select a realm if it is the Realm DB or Profiling DB panel.
  3. In the Configuration tab, select a DBDriver from the Driver drop-down list and provide the driver class path information in the Driver Class Location field.

    Note: For 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 of setenv.bat (setenv.sh on Unix) file during installation or by editing the setenv.bat file.

  4. 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 DBDriver vendor.
  5. Provide the user ID and password.
  6. 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.

Configuring in the dbconfig.xml file

In dbconfig.xml, you can configure the server database using one of two methods. One is to specify the URL, driver, user and password individually. This method of configuration can be modified through the JReport Administration page. For example:

<database name="systemtables/realmtables/profile">
    <url>...</url>
    <driver>...</driver>
    <user>...</user>
    <password>...</password>
</database>

Note: The <user> and <password> information is encrypted. The <user> and <password> tags will be replaced by the <encrypt-sign> tag after JReport Server's startup 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 the dbconfig.xml file.

The other is to use the <datasource> tag. For example:

<database name="systemtables/realmtables/profile">
    <datasource>
        jdbc://user:password@jdbc:odbc:jreport-realmtables#driver=sun.jdbc.odbc.JdbcOdbcDriver
    </datasource>
</database>

Here are two examples for your reference:

Notes: