Most of the applications’ performance can be tested by triggering HTTP, FTP or some other protocols. But there are some cases where we want to directly test the database system without interfering the HTTP calls. Apache JMeter has a built-in JDBC Request module. We can do database testing with JMeter. Let’s see how!
JMeter can connect to any database and run SQL queries concurrently. In order to do so, it’s mandatory to have necessary JDBC drivers in the lib folder of your installation.
Most important part of the Database performance testing is to have valid connection strings in JDBC Connection Configuration.
Just add a JDBC Connection Configuration by using Add-> Config Element menu. There are some fields that should be filled out.
[caption id=”attachment_983" align=”aligncenter” width=”600"]
Database Testing with JMeter[/caption]
Lastly, add a JDBC Sampler using Add->Sampler menu. Just fill out the Variable Name property you defined in the configuration. It must be exactly the same. Every request should be bound to a JDBC Configuration. If it’s not, the statement will not be executed by JMeter.
[caption id=”attachment_984" align=”aligncenter” width=”600"]
Database Testing with JMeter[/caption]
Then you are ready to go. Just run your JMeter plan and execute performance test into your database directly.
Moreover, I kindly recommend checking our Defining KPIs in Performance Testing article.
Happy Load Testing!
Originally published at loadium.com on March 23, 2018.