jmeter mysql database connection

A preparatory work
jmeter tool
to download the driver wrapped the mysql (mysql-connector-java-5.1.26 -bin.jar)
two .jmeter connect to the database
1. Add jdbcl connection configuration: Right-click (Test Plan) -> Add - -> configuration elements -> JDBC connection the configuration
2. need to fill out the contents of
variable name: variable name (will be used later)
database the URL of: connection address mysql database
JDBC driver class: drive mysql database
Username: database login
Password: database password

 

 

3. Import mysql driver package
will be downloaded into the driver package mysql lib directory jmeter the
selected test plans, to classpath security at the click Browse button Add directory or jar, choose mysql driver package

 

Third, the Request Add the JDBC
1. Add thread group, then add request jdbc: Right-click (thread group) -> Add -> Sampler -> the JDBC the Request
2.Variable the Name: variable name entered when connecting to the database
3.SQL query: fill sql statement
4.Variable names: fill in the select statement setting out the query field values to variables [in the order]
5. JDBC Reuest add value to a variable Debug PostProcessor View

6.添加一个查看结果树,在响应数据中可查看到查询结果

 

Guess you like

Origin www.cnblogs.com/c-juan/p/11058907.html
Recommended