Skip to content

Instantly share code, notes, and snippets.

Created February 29, 2016 17:09
What would you like to do?
How to easily use JDBC in a SoapUI Test Case

How to easily use JDBC in a SoapUI Test Case

Choose the DB and get the JDBC driver

First we need to know to which DBMS we want to connect. You can find all the supported driver in the JDBC Driver List page of the SoapUI website. Take note of the Driver name, i.e. oracle.jdbc.driver.OracleDriver and download the .jar file.

Put the jar file in the ext directory, it should be in ithe same folder as the SoapUI start script. In Linux, you can find it in this way:

$~ which SoapUI-5.2.1
$~ ls -l /usr/local/bin/SoapUI-5.2.1
lrwxrwxrwx 1 root root 44 feb  9 15:40 /usr/local/bin/SoapUI-5.2.1 -> /opt/SmartBear/SoapUI-5.2.1/bin/SoapUI-5.2.1
$~ cd /opt/SmartBear/SoapUI-5.2.1/bin             
$bin ls -l
drwxr-xr-x 2 root root     4096 feb 29 17:50 ext

Use the connection in a JDBC Request Test Step

  1. Create a JDBC Request Test Step in a Test Case;
  2. set the driver name in the Driver field, i.e. oracle.jdbc.driver.OracleDriver;
  3. set the Connection String, i.e. jdbc:oracle:thin:user/password@//host.or.ip.address:1521/SID;
  4. click on the TestConnection button to test the connection.

Now you can use the SQL Query to get values or verify them.


Copy link

Great tip, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment