The following steps can be applied to WebLogic 10.3. These instructions apply to applications that leverage 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 (that is, 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.
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>/wlserver_10.3/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
.
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 we will be providing to the new JDBC data source.
JNDI names often take a hierarchical directory-like form to indicate subcontexts. For example, if your original Data Source JNDI name is |
Specify the JDBC connection URL prefixed with the Parasoft JDBC Driver string. For example:jdbc:parasoft:proxydriver:org.apache.derby.jdbc.ClientXADataSource:@jdbc:derby://localhost:1527/medrec
Provide any properties that may be needed for your database (as obtained from step 2 above).
(Optional) Provide a Test Table Name or a SQL query to test the new Data Source, then click Test Configuration. System properties may need to be added if any were defined in the original data source (from step 2).
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:
In this case, use the message to resolve the error. Look at the Parasoft JDBC Driver log file at the location you provided in the logFilePath
property for more details provided by the Parasoft JDBC Driver. Additional logging details are available from the WebLogic server side in the domain’s log location, typically under the servers/DomainName/logs
folder.
For example:
[WebLogic install dir]/wlserver_10.3/samples/domains/medrec/servers/MedRecServer/logs |
Once the test connection succeeds, click Next.
It is possible that “Connection test succeeded” will be displayed despite the fact that Virtualize Server is down (when the Parasoft JDBC Driver is in Record, Virtualize, or Hybrid mode) or if something is misconfigured. Make sure to look at the Virtualize Console view for incoming SQL queries in record mode or refer to the Parasoft JDBC Driver log file to check for the absence of any errors. |
This approach can be applied when you do not want to modify the original data source, perhaps in 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 application’s 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.
JNDI names often take a hierarchical directory-like form to indicate subcontexts. For example, if your original Data Source JNDI name is |
You can call the original data source if it would be easier for you to reference the existing data source (for example, if you have many options set) or if you are using a custom data source factory.
To configure a WebLogic Data Source to call the original data source:
datasource://jdbc/db2Live
, where the first part (datasource://) sets the referencing and the second part (jdbc/db2Live) is the JNDI name of the data source to be referenced.com.parasoft.xtest.jdbc.virt.driver.JDBCProxyDriver
.virtualizeServerUrl
and virtualizeGroupId
.Note:
virtualizeGroupId
and virtualizeServerUrl
) are set on the resource as well. No system properties are needed.virtualizeServerPath
to indicate which Virtualize server path the driver will send request information to. Once your asset is created, you will need to deploy it on that same path. This allows you to send data only to this specific asset.