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
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 /usr/local/bin/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
- Create a JDBC Request Test Step in a Test Case;
- set the driver name in the
- set the Connection String, i.e.
- click on the
TestConnectionbutton to test the connection.
Now you can use the SQL Query to get values or verify them.
Great tip, thank you