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