The following steps can be applied to WebLogic 9.2. These instructions apply to applications that lever-age the WebLogic Data Source database connectivity framework, which is the most common (and recommended) method. However, if the application code bypasses the WebLogic framework and connects to a database directly (i.e., it instantiates and manages the JDBC driver and connections on its own), use the instructions provided in JDBC Configuration for Standalone or Other Application Server Platforms.

WebLogic Environment Setup

  1. Find the domain library directory for your WebLogic application. This is where the Parasoft JDBC Driver jar file is copied.
    For example, the lib folder for the WebLogic Medical records sample application domain is usually installed under [WebLogic install dir]\weblogic92\samples\domains\medrec\lib. If you have created your own domain, it might be something like [WebLogic install dir]\user_projects\domains\your_domain\lib
  2. Modify your startWebLogic.cmd (or startWebLogic.sh on Linux) script to include the necessary startup parameters. For example, for the Medical records sample application domain, that script would be located under [WebLogic install dir]\weblogic92\samples\domains\medrec\
    • Above the line that begins with set DOMAIN_HOME= add the following  (as one line): set JAVA_OPTIONS=%JAVA_OPTIONS% -Dparasoft.virtualize.server.url=http://[virtualize server host name]:9080 -Dparasoft.virtualize.group.id=ParaBank
  3. Restart WebLogic so that it will load the new  jar and have these properties applied.

Creating a New JDBC Data Source

  1. Log in to the WebLogic server administration console.
  2. Under the Domain Structure, expand Services> JDBC and click Data Sources.



  3. Identify the Data Source that is currently used by your application and note the JNDI name that it is set up with (as well as any values set in the Properties field).



  4. Open the Targets tab, uncheck the servers on which the Data Source is deployed, then click Save. Alternatively (or in addition to this action), you might change the JNDI name so that it does not conflict with the same JNDI name that you will be providing to the new JDBC data source.

    JNDI Naming Tip

    JNDI names often take a hierarchical directory-like form to indicate subcontexts. For example, if your original Data Source JNDI name is jdbc/zOS_DB2DataSource, then you should avoid renaming it to jdbc/zOS_DB2DataSource/Original (using a / divider) because that can cause JNDI binding conflicts in the application. Instead, use names such as jdbc/zOS_DB2DataSourceOriginal and avoid your JNDI name being interpreted as a subcontext.

  5. Return to the Data Sources section and do the following:
    1. Click New.
    2. Under JDBC Data Source Properties, complete Name and JNDI Name with the details from the previous step.
    3. Set the database type to Other.
    4. Set the driver to Other.
    5. Click Next.



  6. Under Transaction Options, uncheck the Supports Global Transactions option, then click Next,



    Although the driver emulates the JDBC commits APIs, enabling these options has not been fully verified with the Parasoft JDBC Driver.
  7. Under Connection Properties, specify the connection settings for the original database, then click Next.



  8. Under Test Database Connection, do the following:
    1. Specify the fully qualified Parasoft JDBC Driver class name. For example: com.parasoft.xtest.jdbc.virt.driver.JDBCProxyDriver. See JDBC Driver Implementation Classes for details.
    2. Specify the JDBC connection URL prefixed with the Parasoft JDBC Driver string. For example: jdbc:parasoft:proxydriver:oracle.jdbc.driver.OracleDriver:@jdbc:oracle:thin:@beast:1521:XE
    3. Provide any properties that may be needed for your database (from step 3 above).
    4. (Optional) Provide a test table name (or a full SQL statement prefixed with SQL); this lets you test the data source configuration without having to run a scenario on your application.



    5. Click Test Configuration. The messages section at the top will indicate the test result. If it succeeds, you will see the following message:



      If there is an error, you will see this message with an exception stack trace:



      In this case, you can follow any error instructions to correct the configuration or inspect the Parasoft JDBC Driver log file (at the location provided in the log file location property) in order to correct the problem.
      Once the test connection succeeds, click Next.
  9. Under Select Targets, specify the servers where the original Data Source were deployed, then click Finish.



  10. Activate the changes in the top left corner of the page (at the Change Center section).

Alternative Method: Modifying Application Settings To Use the Parasoft JDBC Driver With a Different JNDI Name

This approach can be applied in the cases where you do not want to modify the original data source-–perhaps in the cases where the same data source is used by multiple applications and you want to virtualize the database connections for only a specific application. Under these circumstances, you may be able to modify the applications data source JNDI binding through the administrative console.

Deployed applications can be accessed through the Deployments section under the Domain Structure tree.

Locate the desired application module and modify the JNDI name for the JDBC data source that it is using.

 

  • No labels