Installation considerations for the JDBC proxy
HCL DevOps Test Virtualization Control Panel (Test Virtualization Control Panel) includes a JDBC proxy. Before you install and configure the JDBC Proxy, it is important to determine which live databases are to be stubbed and whether there are any database schema or data source requirements.
JDBC Requirements
Database virtualization happens at the JDBC level, hence, the application code must use only the standard interfaces. If database vendor-specific calls are required then the object types must be checked by using instanceof before optionally casting to the vendor type and using the object.
You will find that the connection interface is not of the target vendor type and the interface will be wrapped in a different type.
Determining live databases for stubbing
Identify in advance the live databases that you want to record and or stub. For each live database, determine whether access is taking place by using either the Java DriverManager or through the use of DataSources, which will inform the installation requirements and configuration changes.
- If an application that uses JDBC to access the database is a stand-alone application, it will use the DriverManager and the JDBC Proxy must be installed in each application.
- If an application that uses JDBC to access the database is a hosted application, it will use DataSources and the JDBC Proxy must be installed on the application servers that host them, not in the applications.
HCL DevOps Test Integrations and APIs (Test Integrations and APIs) does not have to be connected to any of the other applications that use JDBC to access the live database. Instead, as each driver starts, it registers with the Test Virtualization Control Panel. Test Integrations and APIs and the Test Virtualization Control Panel dashboards are then used to control recording and stubbing.
As the configuration details differ from application to application and more so from application server to application server, you must refer to the different vendor documentation, as an example, DriverManager setup is described in Deploying JDBC proxy into Apache Tomcat and DataSource setup is described in Selecting and enabling JDBC data sources in WebSphere® Application Server.
Determining database schema requirements
Determining data source requirements
If you are using IBM® WebSphere® Application Server or Oracle WebLogic, you must complete the following tasks before you can create and configure a data source for SQL recording and database stubbing.
- Set up a data source for each logical database that is configured in Test Integrations and APIs because a data source is needed for each simulation database.
- Ensure that each data source remains synchronized with the simulation database settings for the physical database resource.
For information about using Test Integrations and APIs to create and configure IBM® Db2® data sources and other data sources for SQL recording and database stubbing, see Selecting and enabling JDBC data sources in WebSphere® Application Server.