Deploying JDBC proxy into an Oracle WebLogic Server

The JDBC proxy must be deployed on each application server that is running WebLogic. The JDBC proxy enables a server that hosts applications to use JDBC to access a live database that you want to record or virtualize.

About this task

The instructions are based on Oracle WebLogic Server 10.3 running on Microsoft Windows.

If you are using a different version of WebLogic Server or a different operating system, or deploying the JDBC proxy in a clustered WebLogic Server environment, some of the steps might be different.

For more information, see the Oracle website or WebLogic Server product documentation.

Procedure

  1. Download and extract the JDBC driver that is provided with HCL Quality Server. For more information, see HCL OneTest API tool packages.
  2. Copy the files that are listed in the following table and the JDBC proxy configuration file (registration.xml) from the downloaded JDBCIntercept.zip package to <Oracle installation directory>\Middleware\wlserver<Version number>\server\lib or to whichever WebLogic Server folder contains JDBC drivers.
    JDBC / Java version File name Description
    JDBC 4, Java 1.6 or later

    com.ibm.rational.rit.jdbcdriver4.jar

    jsqlparser15.jar and antlr-3.4.jar

    The JDBC proxy.

    Supporting libraries.

    Notes:
    • Currently, JDBC 4, Java 1.6 or later is supported for the JDBC proxy and its supporting libraries. You must add the three JAR files com.ibm.rational.rit.jdbcdriver4.jar, jsqlparser15.jar and antlr-3.4.jar to each application server directory that contains JDBC drivers.
    • The following items are not supported for vendor-specific Oracle SQLs:
      • Oracle-specific DDL statements
      • Custom functions
      • Subqueries
      • PIVOT and UNPIVOT statements
      • Nested tables containing multiple columns or single column of user-defined-types
      • Stubs with nested tables
  3. Update the CLASSPATH of WebLogic Server with the path to the driver files based on the Java and JDBC version that you are using. Modify the CLASSPATH in the commEnv.cmd file in <Oracle installation directory>\Middleware\wlserver<Version number>\common\bin to one of the following examples:
    set WEBLOGIC_CLASSPATH=%WL_HOME%\server\lib\greenhat.jdbcdriver.jar;%WL_HOME%\server\lib\jsqlparser15.jar;%WL_HOME%\server\lib\antlr-3.4.jar;%WL_HOME%\server\lib\registration.xml;...
    
    set WEBLOGIC_CLASSPATH=%WL_HOME%\server\lib\com.ibm.rational.rit.jdbcdriver4.jar;%WL_HOME%\server\lib\jsqlparser15.jar;%WL_HOME%\server\lib\antlr-3.4.jar;%WL_HOME%\server\lib\registration.xml;...
    Note: If the JDBC proxy files are in a location other than <Oracle installation directory>\Middleware\wlserver<Version number>\server\lib, the correct location must be mentioned in the CLASSPATH.
  4. Save and close the commEnv.cmd file.
  5. Restart the WebLogic server.
  6. Log in to WebLogic Server Administration Console.
  7. On the Domain Structure tree, expand Services.
  8. Expand JDBC.
  9. Click Data Sources.

    The Summary of Data Sources page is displayed.

  10. Click New.

    The Create a New JDBC Data Source page is displayed.

  11. In the Name and JNDI Name fields, enter a name and a JNDI name for the Green Hat data source.
  12. In the Database Type list, click Other.

    The selected driver in the Database Driver list changes to Other.

    Note: If the selected driver does not change, click Other.
  13. Click Next.
  14. Select the Supports Global Transactions check box.
  15. Select an option for transaction processing.
    Important: The available options vary depending on whether you select an XA driver or a non-XA driver.
  16. Click Next.
  17. In the Database Name, Host Name, Port, Database User Name, Password, and Confirm Password fields, enter details about the (live) physical database resource in HCL OneTest API.
  18. Click Next.
  19. Enter com.greenhat.jdbc.Driver in the Driver Class Name field.
  20. In the URL field, enter the real URL of the database.

    The Database User Name, Password, and Confirm Password fields are populated from the previous page.

  21. Optional: Click Test Configuration to verify that WebLogic Server can connect to the specified database.
  22. Click Next.
  23. Select the check box of each deployment target for the new JDBC data source.
  24. Click Finish.
  25. To activate these changes, in the Change Center of the Administration Console, click Activate Changes.
    Tip: To ensure that all of the changes take effect, you might need to restart the WebLogic server.
  26. Edit the server tag in the registration.xml file to the URL of the HCL Quality Server installation that is being used.
  27. Optional: Edit the domain and environment tags in the registration.xml file.
    Important: If these tags are modified, the JDBC proxy is used only when you record and stub within the specified domain and environment.

Results

The JDBC proxy is now deployed on Oracle WebLogic Server.

Use HCL OneTest API and HCL Quality Server to control JDBC recording and stubbing.