Home > Configuring JReport Server > Configuring another connection as a substitute for the catalog connection > Example 2: Using JNDI data source connections of JBoss server

Example 2: Using JNDI data source connections of JBoss server
Using JBoss as an example, in this Example, DB2 is used, and JBoss is installed to D:\jboss-4.0.1
, take the following steps:
- Copy the DB2 driver to
D:\jboss-4.0.1\server\default\lib
.
- Create a db2-ds.xml file in
D:\jboss-4.0.1\server\default\deploy
, and add the following content:
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>DB2DataSource</jndi-name>
<connection-url>jdbc:db2://dbs-b/sample</connection-url>
<driver-class>com.ibm.db2.jdbc.net.DB2Driver</driver-class>
<user-name>db2admin</user-name>
<password>db2admin</password>
<min-pool-size>0</min-pool-size>
<metadata>
<type-mapping>DB2</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
|
- Modify datasource.xml in
<install_root>\bin
. Make sure that the following are included:
<datasource-mapping>
<datasource>
<catalog-connection-name>ConnectionName</catalog-connection-name>
<connection-type>JNDI</connection-type>
<jndi-datasource>java:/DB2DataSource</jndi-datasource>
</datasource>
</datasource-mapping>
|
- Build the JReport Server WAR file using the makewar.bat utility in the
<install_root>\bin
directory.
- Deploy JReport Server to JBoss.
- Run the report that uses this connection.
