Premise: Database ready data, download good JDBC driver
1. Add a jar package to your test planClick on test Plan, test plan interface Click the Browse button, add jdbc Jar package
2. Add JDBC Connection ConfigurationFirst add a thread group, and then add the thread group right------Configure the component->jdbc Connection Configure the JDBC Connection configuration:
- Variable Name: Database connection pool names, we can have more than one JDBC connection configuration, each can be a different name, in the JDBC request can be selected through the name of the appropriate connection pool for use
- Database Url:jdbc:mysql://host:port/database (Modify host, port, database)
- JDBC Driver Class:com.mysql.jdbc.Driver
- Username: User Name of database login
- Passwrod: Password for database login
3. Add JDBC RequestThread group Right->SAMPLER->JDBC requestvariable name: The name should match the variable name of the JDBC Connection configuration config query: Write query statement (not required) ;”)
4. Adding assertionsRight-click Add-assert-response assertion for thread groups: response fields and pattern matching rules default
5. Add assertion results, graphical results, view result treeThread group Right--add listener---assertion result/Graph result/view result tree
6. Post-run view (ctrl+r/run-start/Start button) Assertion result: JDBC request for successful viewing result tree: Response data as query result
Creating a Database (Mysql) test using JMeter