Previous Topic: Multiple Data Set EditorNext Topic: Database Virtualization Troubleshooting


JDBC Virtual Service Model

In agent-based JDBC virtualization, the virtual service that you generate includes a virtual service model.

The virtual service model has the same listener and responder steps as in Java VSE:

To view the protocol configuration information, open the listener step and double-click JDBC protocol in the lower right list. The Protocol Configuration dialog opens. This dialog contains a set of key/value pairs.

Important! Do not delete any of the rows. If you delete a row, the system under test will not work correctly.

The following graphic shows the Protocol Configuration dialog. This example is based on the Apache Derby database.

Screen capture of Protocol Configuration dialog.

The url_pattern key specifies the connection URL that triggers virtualization at playback. If the value ends with a semicolon followed by the text user= and a database user, the virtualization is restricted to that database user. You can add key/value pairs for additional database users. The key for each user must begin with url_pattern_.

The second key is composed of the driver class name and the connect method. The value is the name of the connection class.

The third key is composed of the connection class name and the prepareStatement method. The value is the name of the prepared statement class.

Notice how the second and third keys create a "chain" of driver to connection to statement.

The keys that begin with java.sql.DatabaseMetaData contain name and version information for:

The keys at the bottom contain a mapping of a specific SQL statement and the parameter metadata that the statement represents.

 

Match Exceptions

The Throw exceptions on no match property lets you control what happens when the virtual service model does not have an answer for a SQL statement. By default, the property is enabled.

You can configure this property from the Agents window of the DevTest Portal. The property appears in the Settings tab.