Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

JDBC Connection Configuration in JMeter

Category: JMeter

When testing your APIs, web service or other system parts, you might need to record or retrieve data from a database.
Before you start working with a database by using JMeter, you need to do the following:

Make sure there is a user who has permission to connect and perform common actions CRUD in the database.
Make sure the database is available for remote or local access.

To interact with the database it is necessary to:
1. Download the DB Connector Driver for specific DB (MySQL/MSSQL,etc)
2. Copy the DB Connector jar to ..\apache-jmeter-3.2\lib folder
3. Restart JMeter
4. Right click on Thread Group -> Add -> Config Element -> JDBC Connection Configuration
5. Fill in the Variable Name field. The value of this field is used to associate a specific connection configuration (JDBC Connection Configuration) to the database and a specific request (JDBC Request) sent by JMeter
6. Configure the JDBC Connection Configuration. Ex: jdbc:mysql://localhost:3306/DB_Name
7. JDBC driver class : com.mysql.jdbc.Driver
8. Provide User name and password for accessing the DB

JDBC Request:
1. Use the same variable name what given in JDBC Connection Configuration.
2. Set the Query Type. Ex: Select Statement
3. Result variable name – This variable will store all fields and field values received from the database.

Leave a Reply

Your email address will not be published. Required fields are marked *