There are two ways to set up a JDBC connection:
- Use project-level JDBC connections-In this case, the driver, connection string, and Password properties will use the configuration values of the selected JDBC connection (but these fields will be disabled and read-only).
- Text field value using driver/connection string/password-in this case, the database connection is set to "None":
When you build the query and run Teststep, the specified settings (that is, the JDBC connection or driver, the connection string, and the password) are used.
The JDBC panel consists of the following components:
- Query Properties-number of properties can be added to replacement in query through Prepared Statement. Properties need to being specified in the query as ":p Ropertyname" and would by replaced by exact names. These properties can be added and made in a query by declaring variables Replace. The property needs to be specified as ": PropertyName" in the query and will be replaced by an exact name.
- JDBC Connection selection with options
- Create-new-Add a new JDBC connection
- None-Do not use the JDBC connection, but instead use the driver/connection string/password value
- Project-level JDBC connections
- button for configuring the selected JDBC Connection-enabled only when connection is selected (this applies to project-level connection settings)
- Driver
- Connection string
- Password
- Buttons for configuring connection properties-enabled only when no connection is selected, but with normal connection properties
- Button for testing connection
- SQL Query
- Indicator if the query is a stored procedure call
- Button for building the SQL query (SoapUI Pro only)
- Assertions PANEL-JDBC results can be asserted like any other XML result, with two additional assertions: JDBC Timeout-If the query is executed within a predefined time, the JDBC status-assertion executes the query state
- Result can be displayed in XML view
- Outline View (SoapUI Pro only)
DatabaseConnection Configuration
Depending on the driver that you select from the list of configured JDBC driver properties, you can obtain a list of properties to populate or change to configure the connection. Configuration changes will also immediately affect the project level.
Configuring SQL queries
There are two options for configuring the SQL query you want to use:
- A simple list of stored procedures and the available output parameters-starts when the stored procedure check box is selected
- A powerful visual query builder for creating complex SQL queries with federation and subqueries-starts when the stored procedure check box is not selected
For the visual query Builder, there are two preview tabs at the bottom of the window:
- SQL Preview-where you can view the SQL queries you have created and add the properties you want to use in your query
- Result Preview-Displays the current query results as a normal table without additional options.
There are many possibilities for visually building queries, including
- Add an object to a query-you can simply double-click the object in the right tree or drag it to the query area
- You can also choose to add Union queries and subqueries by right-clicking the query area.
Testing the JDBC Database