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 follows. 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 follows:

      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 setenv.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 ADDCLASSPATH variable of setenv.bat. In this example, supposing that you have installed JReport Designer in C:\JReport\Designer, and WebLogic in C:\bea, you will have to modify setenv.bat in C:\JReport\Designer\bin to add C:\bea\wlserver6.1\lib\weblogic.jar to the ADDCLASSPATH variable as follows:

    set ADDCLASSPATH=%JAVAHOME%\lib\tools.jar;C:\bea\wlserver6.1\lib\weblogic.jar;

  7. Set up the connection.
    1. Start JReport Designer and open the catalog.
    2. In the Data tab of the Catalog Browser, right-click the node of the default data source and select Add JDBC Connection from the shortcut menu.
    3. In the Get JDBC Connection Information dialog, check Use Connection Pool. The string weblogic.jinfonet.pool.Driver will automatically be displayed in the Driver text field.
    4. Fill in the URL jdbc:weblogic:jinfonet:@<hostname>:7001:jinfonetDS, where @<hostname> is the host name or IP address 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.