How to Query Parabank Database

[Deleted User][Deleted User] Posts: 0
edited May 2017 in SOAtest

If you're looking to query and validate result sets from a relational database, you can use Parabank (a demo application built into SOAtest) to demonstrate the concept.

These instructions assume that you've already deployed Parabank. For instructions on how to do that, see the section called "Setting Up ParaBank" in the SOAtest Tutorial (within the User Guide).

1) You’ll need to get the client driver jar (hsqldb-2.x.x.jar) from the Parabank deployment directory (TOMCAT_HOME/webapps/parabank/WEB-INF/lib)
2) In SOAtest, go to Parasoft -> Preferences -> JDBC Drivers . Click New and add the driver:

Note: If you are ever attempting to connect to a database from an extension script, you must instead add the driver jar to “System Properties.” JDBC Drivers is used specifically for the DB Tool in SOAtest.

3) Add a DB tool in SOAtest. Add these connection details on the Connection tab (replace PARABANK_HOST with your Parabank instance’s IP address or host name):

Driver: org.hsqldb.jdbcDriver
URL: jdbc:hsqldb:hsql://PARABANK_HOST/Parabank
Username: sa
Password:

On the SQL Query tab, write a SQL query that will produce a result set from the db. Here’s an example that gets all transaction details for account id 13344: select * from account where id = '13344'

Remember that SOAtest outputs the result set as XML (meaning you can attach an XML Assertor to validate results). Also remember that you can parameterize values in the SQL query, like this: select * from account where id = '${newAccountNumber}'

If you ever need to invoke a stored procedures, expand Query Options below to enter parameter types. The Users Guide goes into detail about the proper syntax.

Sign In or Register to comment.