JMeter implementation of MySQL additions and deletions to change the operation

Source: Internet
Author: User

Environment:

JDBC Driver: Mysql-connector-java-5.1.7-bin

jmeter:jmeter3.0

1. Import the JDBC Driver: test Plan-Browse-select Mysql-connector-java-5.1.7-bin ""

2. Add thread Group: test Plan right--add-->threads (Users)--Thread Group

2. Thread group Right--add--Configure component-->jdbc Connection configuration

Fill in the database address, user name and password:

Database Url:jdbc:mysql://172.16.1.42:3306/alina?allowmultiqueries=true

JDBC Driver Class:com.mysql.jdbc.Driver

3. Add JDBC Request

Thread Group Right-click Add-->sampler-->jdbc Request

Query type (SQL statement type):

1, select Statement: Query statement type, if the JDBC request is a query statement, select the type. If you write multiple query statements in the query of the JDBC Request, it executes only the first SQL statement.

2. Updata Statement: UPDATE statement (INSERT and update). If you write multiple UPDATE statements in the query of the JDBC Request, it executes only the first SQL statement.

3, callable Statement: Call statement. Select the item when you execute more than one statement.

4.Commit: writes the result of an unsaved SQL statement to a database table.

5, Rollback: The process of revoking the specified SQL statement.

4.

Insert into Alina (Id,username,password) VALUES (8, "Test8", "123");
Delete from Alina where id=98;
Update Alina Set username = "hahaha" WHERE id = 5;
SELECT * from Alina;

JMeter implementation of MySQL additions and deletions to change the operation

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.