JMeter implementing MySQL Multi-type SQL statement requests

Source: Internet
Author: User

Tag: set operation an ima src es2017 picture Execute Query

first, the environment preparation:

 1. Prepare a database containing the necessary data;

2, JDBC driver;

second, the operation steps:

1, add the JDBC driver;

 2, add "thread Group", and add a "JDBC Connection Configuration" below;

 3, configure the JDBC Connection configuration page, enter the database

1) database url:jdbc:mysql://localhost:3306/hkktest, where Hkktest is the name of the databases;

2) Username and password fill in the correct account and password;

 4, add JDBC Request under the thread group;

 5, the JDBC request writes the SQL statement, and chooses the correct type;

 6, it should be noted that this setting can only write a single statement, if you try to execute multiple types of SQL statements, there are the following two scenarios:

Programme one:

1) First, set up the stored procedure and take care not to execute the call statement;

 2) Perform the operation in the JDBC request of JMeter;

  When you click "Start", you find that the database data response has changed.

Scenario two: In the JDBC Connection configuration page, Database url:jdbc:mysql://localhost:3306/hkktest add after? allowmultiqueries=true , and then select the query type in the JDBC request as callable Statement.

7. Add response assertion, assertion result, graphical result, view result tree;

  

 1) SQL statement: SELECT Name from students where id= ' 801 ';

2) Expected results:

 3) JMeter operation result:

JMeter implementing MySQL Multi-type SQL statement requests

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.