JMeter connecting MySQL

Source: Internet
Author: User

The first step is to download the JDBC driver jar

The second step is to add the jar path in the test plan (if the drive jar is placed in the path. \apache-jmeter\lib directory, you can eliminate the step of adding a path)

Step three, add the JDBC Connection Configuration

Fourth step, configure the JDBC Connection configuration

Variable Name: Database connection pool name, custom, JDBC request to be consistent with it

Database url:jdbc:mysql://DB IP Address: Database port/Database name

JDBC Driver Class:com.mysql.jdbc.Driver

Username: Database user name

Password: Database Password

Fifth step, add the JDBC Request

Variable Name: Database connection pool name consistent with the Variable name Bound pool name of the JDBC Connection configuration

1) Parameter values: parameter values for parameterized queries

Parameter types: Parameter types for parameterized queries

Parametric query:

Method One, use the ${variable name in the SQL statement}, such as select Verificationcode from ' Smscode ' WHERE acount =${acount} ORDER by Createtime DESC LIMIT 1;

Method Two, use "?" in the SQL statement. "Placeholder, you need to set" Parameter values "," Parameter types ", multiple variables using", "delimited, such as:

Parameter values are variables, use the ${variable name} in the same way as:

2) Variable names: Total number of rows of data and data returned by the Save SQL statement

test_#: Total number of rows

The first row of the Test_1,test column

Referencing by using the ${test_#},${test_1} method

3) result variable name: Create an object variable that holds all returned results

For an example, see:

4) Query timeout: Query time-out

5) Handle result set: Defines how to handle the results returned by the callable statements statement

JMeter connecting MySQL

Related Article

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.