Creating a Database Test Plan/Load Test On Database Using JMeter

A database application with high response time and poor performance can lead to huge problems. Database Load Testing helps in identifying the performance problems before you deploy your database applications for end-users.

  • It helps you design and simulate usage traffic, which can be used to test your Database application infrastructure for performance, reliability, and scalability.
  • Load Testing of Database applications involves testing the performance and scalability of your Database application with varying user load.
  • Database Load testing involves simulating real-life user load for the target Database application.
  • It helps you determine how your Database application behaves when multiple users hit simultaneously.
  • We forget to test our database performance. The Database can perform slowly, especially when it’s huge. If your website is calling stored procedures or complex queries, then it might be taking a lot of time to process your data.
  • It’s essential to know your database performance and load handling capacity. One of the open-source tools is JMeter, which helps you assess performance.
The Following EXample Demonstrates the Creating Database Test Plan

Before Establishing the connection between JDBC and JMeter, we need to install Oracle Database in your system.

Configuration of JMeter with Oracle JDBC:

  • We can create any Database, either JDBC or MYSQL.
  • Here I am using JDBC to create a Database.
  • So we need to download the Oracle JDBC Driver.
  • The JDBC Driver is available in the form of Jar file, and this jar file we need to add under the JMeter Lib folder.
  • And after that, we need to restart that JMeter.
  • Now go to the browser and type Download Oracle JDBC Driver. And then click on the First Option as below.
  • Once you click on the Link, it will navigate to the Official website, as shown below.
  • You can download any of the JDBC jar files and save the downloaded jar file under JMeter Lib Folder.
  • Once you click on the download button, it will ask you to accept the Oracle License agreement, check-in the I reviewed, and accept the Oracle License Agreement and click on the Download button.
  • If you do not have an Oracle account, then create an oracle account with valid credentials.
  • After creating an account, click on download and save the jar file under the lib folder in JMeter as below.
  • If you open the library folder, you will find the OJDBC jar file as below.
  • Now restart the JMeter in your system.
  • After restarting the JMeter, add the Thread Group to the Test Plan.
  • Next, we need to add the JDBC Connection Configuration. Right-click on the Thread Group and select Add-->Config Element-->JDBC Connection configuration.
  • The JDBC connection configuration page will look like as below, Which represent the connection details to the Database.
  • Some of the Fields are mandatory to fill, so go to the official website of JMeter from there we can give the values for that, Scroll to a configuration element which is as shown below.
  • Under the configuration, Elements goto the JDBC Connection Configuration.
  • Once you click on the JDBC Connection configuration, you will find the below page, which is an older version table of JMeter.
  • If you scroll down, you will find the Parameters which are present in the JDBC Connection Configuration.
  • The Parameters which are represented as Yes are the mandatory fields, and you can neglect the remaining areas.
  • The Database URL and JDBC Driver class will change from one Database to another.
  • The Database URL will like as shown below, and the JDBC Driver Class will be as shown below.
  • You will get the JDBC Driver Class name in the JMeter official website under parameter.
  • Next, enter the username and password and then save the Test Plan.
  • Next, we need to add a JDBC sampler request, where we need to execute our query.
  • Right-click on the Thread group and the select Add-->Sampler-->JDBC Request.
  • The JDBC request will use the JDBC connection configuration, here we have to give the name of the variable we have assigned in the JDBC Connection Configuration.
  • Next, click on the Query Type and select the Select Statement.
  • Write the simple query as below.
  • Next, add View Result Tree Listener as below.
  • Now, save and run the Test Plan.
  • When I run the Test Plan, I am getting the following error.
0 results
Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions