When there is a need of database load testing, JMeter can play a vital role over there.. Let us see how to make a simple set up for handling database requests using the tool.
Step 1: Create a thread group under the test plan
Step 2: Begin by selecting the DB Users element. Click your right mouse button to get the Add menu, and then select Add-->Config Element-->JDBC Connection Configuration.
- Variable name
- Database URL
- JDBC Driver class
Rest fields can be left blank. JMeter creates a database connection pool with the configuration settings as specified in the Panel.
Step 3: Now we need to add one sampler. Selecting the DB Users element again. Click your right mouse button to get the Add menu, and then select Add --> Sampler --> JDBC Request .
- Provide the Pool Name (same as in the configuration element)
- Enter the SQL Query String field.
- Enter the Parameter values
- Enter the Parameter types
Step 4: Now we need to store/view the output. This can be achieved bu use of a listener. Select the DB Users element and add a Summary Report listener ( Add --> Listener --> Summary Report ). The listener will show the result in below format.
In this way we can handle the database requests Using JMeter.