Specifying data source in web.xml (for the WAR mode)

When integrating the JReport Enterprise Server in a WAR package, you can specify the dsInfo in the WEB-INF/web.xml file using the <env-entry></env-entry> or <context-param></context-param> tags. However, the use of the <env-entry></env-entry> tags is the recommended way since the tags are also supported in ejb-jar.xml (if you call the server API in your EJB).

The following is an example of specifying the dsInfo in WEB-INF/web.xml using the <env-entry></env-entry> tags:

<web-app>
...

<env-entry>
<env-entry-name>jreport.datasource.systables</env-entry-name>
<env-entry-value>jndi://resource-name</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
</web-app> 

The following is an example of specifying the dsInfo in WEB-INF/web.xml using the <context-param></context-param> tags:

<web-app>
<context-param>
<param-name>jreport.datasource.systables</param-name> 
<param-value>jndi://datasource_name_which_is_predefined</param-value>
</context-param> 
...

</web-app>