#### Example 3: Setting up a connection via WebLogic 6.1 Connection Pool

Assume that a catalog has been created with a default data source in JReport Designer. Take the following steps to set up a connection which connects JReport Designer to a database via the WebLogic 6.1 Connection Pool:

1. Set up the WebLogic Connection Pool.
   1. Assume that the WebLogic Server has been started, access the console through a web browser (`http://host:7001/console`). Then, go to the left panel, and expand the JDBC node.
   2. Click the Connection Pools node. All the defined connection pools will be displayed in the right panel.
   3. Click the Configure a New JDBC Connection Pool link.
   4. In the Configuration tab, define the connection pool as below. Then, click the Create button.

      Name: jinfonet
      URL: jdbc:odbc:jinfonet
      Driver Classname: sun.jdbc.odbc.JdbcOdbcDriver

2. Check the Connection Pool.

   In the Monitoring tab, click the link Monitor all Active Pools to check if the pool is active. You will see the connection pool that you just created appear in the Monitoring tab.

3. Click the Targets tab, and add examplesServer to the Chosen column (in order to assign the connection pool to the server). Then, click Apply to save your changes.
4. Set up the data source.
   1. Click the Data Sources node in the JDBC node. In the right panel, click the Configure a New JDBC Data Source link.
   2. In the Configuration tab, enter the values in the following fields as below:

      Name: jinfonetDS
      JNDI Name: jinfonetDS
      Pool Name: jinfonet

   3. Click Create. The new data source will then be added in the Data Sources node in the left panel.
5. Click the Targets tab and add examplesServer in the Available column to the Chosen column. Then, click Apply to save the changes.
6. Add weblogic.jar to JReport.bat.

   To connect via the WebLogic Connection Pool in JReport Designer, you will first need to add weblogic.jar in `<weblogic_install_root>\wlserver6.1\lib` to the class path in the batch file JReport.bat that is used to start up JReport Designer. In this example, supposing that you have installed JReport Designer in `C:\JReport\Designer`, and WebLogic in `C:\bea`, you will have to modify JReport.bat in `C:\JReport\Designer\bin` to add `C:\bea\wlserver6.1\lib\weblogic.jar` to the class path:

   `... -classpath "C:\JReport\Designer\lib\report.jar;C:\JReport\Designer\lib\resource.jar;C:\bea\wlserver6.1\lib\weblogic.jar...;
   C:\TEMP";"C:\JReport\Designer" -Dreporthome="C:\JReport\Designer" jet.report.ide.JReport ...`

7. Set up the connection.
   1. Start JReport Designer using the modified batch file JReport.bat and open the catalog.
   2. In the Data tab of the Catalog Browser, expand the node of the default data source, right-click the Relational node and select Add JDBC Connection from the shortcut menu.
   3. In the Get JDBC Connection Information dialog, uncheck Use ODBC Data Source, and check Use Weblogic Pool Connection. The string weblogic.jinfonet.pool.Driver will automatically be displayed in the JDBC Driver text box.
   4. Fill in the JDBC URL jdbc:weblogic:jinfonet:@192.168.126.101:7001:jinfonetDS, where @192.168.126.101 is the host of the WebLogic Server, 7001 is the port on which the WebLogic Server listens, and jinfonetDS is the JNDI Name of the data source. Then, click OK.

Note: The data types longbarbinary and BigDecimal are not supported when a WebLogic Connection Pool is used.