After using JMeter to connect to the database, you can construct a request for database pruning in JMeter to test the database, following the MySQL database as an example to demonstrate the steps of JMeter connection to MySQL and process query operations.
1, ensure that the MySQL database can be connected properly, you can use the SQLyog tool connection test; Prepare the JDBC driver package for MySQL database: Mysql-connector-java.jar.
2. Build the following test plan to add the Mysql-connector-java.jar package to the test plan.
3, add the thread group, under which the JDBC Connection configuration is added, you can add more than one connection configurator, using variable name to differentiate. Specify the database URL, JDBC driver class, database connection user name, and password. Where test is the name of the database that needs to be connected.
Refer to the JMeter Help for specific field meanings and other database URL and driver classes. Such as:
4. Add the JDBC Request Sampler, specify the connection configuration used by variable name, select the type of query (add, delete, change, check, etc.), and fill in the query statement that needs to be tested.
5. Observe the success of the request by looking at the result tree (or in response to the assertion).