Configuring the datasource.xml file

In order to enable you to conveniently set different connections in JReport Enterprise Server, a configuration file, datasource.xml, is provided with which you can define the connection to use at runtime by setting up connection mapping information such as the JDBC driver, URL, or JNDI data source name, user and password, depending on the data source your application uses.

The datasource.xml file is located in the <install_root>\bin directory. Change this file according to the data source you want to use. Two types of connections are supported by JReport Enterprise Server. They are JNDI data source connection and JDBC connection.

The content of the datasource.xml file is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<datasource-mapping>
<datasource>
<catalog-connection-name>Connection1</catalog-connection-name>
<connection-type>JNDI</connection-type>
<jndi-datasource>Sample</jndi-datasource>
</datasource>
<datasource>
<catalog-connection-name>Connection2</catalog-connection-name>
<connection-type>JDBC</connection-type>
<driver>sun.jdbc.odbc.JdbcOdbcDriver</driver>
<url>jdbc:odbc:jinfonet</url>
<user>Username</user>
<password>Password</password>
</datasource>
</datasource-mapping>

Element descriptions

Notes: