JMeter can also be used for database stress testing, and compatible with various database types, only the corresponding database driver classes and URLs need to be changed. The following is the URL for the database-driven class to be organized. and give a simple application of MySQL database select. As follows:
A different database-driven class and the corresponding URL:
Datebase |
Driver class |
Database URL |
Mysql |
Com.mysql.jdbc.Driver |
Jdbc:mysql://host:port/{dbname} |
PostgreSQL |
Org.postgresql.Driver |
Jdbc:postgresql:{dbname} |
Oracle |
Oracle.jdbc.driver.OracleDriver |
Jdbc:oracle:thin:user/[email Protected]//host:port/service |
Ingres (2006) |
Ingres.jdbc.IngresDriver |
Jdbc:ingres://host:port/db[;attr=value] |
MSSQL |
Com.microsoft.sqlserver.jdbc.SQLServerDriver Or Net.sourceforge.jtds.jdbc.Driver |
Jdbc:sqlserver://ip:1433;databasename=dbname Or jdbc:jtds:sqlserver://localhost:1433/"+" library " |
Two MySQL SELECT statement stress test Case:
1 Adding a JDBC request
1) Enter JMeter path bin, double hit Open jmeter.bat
2) Add a thread group: edit, add a->threads-> thread group
3) Add a JDBC request for the thread group: Select Thread Group, add->SAMPLER->JDBC request
Fill in the corresponding test statements, additions and deletions are set in query type.
4) Add the JDBC configuration symbol: Add, configure component->jdbc Connection configuration
5) You can add a listener to test it.
2 question: "Response message:java.sql.SQLException:No suitable driver found Forxxx", as
FIX: Missing driver, download mysql-connector-java-gpl-5.1.37,:http://dev.mysql.com/downloads/file.php?id=459311
Put it under the Jmeter/lib and run again will find Ding-dong, become
3 Note: If necessary, please save JMeter pure version (initial download status), my jmeter took too long to add too many things, how to run will prompt this "problem", download the new JMeter no longer this problem.
JMeter complete a MySQL stress test