-
Test sql performance can be tested by creating a new jdbc request in jmeter ; when testing sql performance, a jdbc request can only execute one statement;
-
There are three main steps when testing:
-
Set jdbc connection pool;
"test plan" add "configuration original" jdbc connection configuration
-
After setting, add jdbc request request;
Thread Group "Add" "sampler" jdbc request
Detailed description of ※ place:
query type |
Detailed description |
Whether to support the reference variable $ {} into the parameter |
Whether to support placeholder filling mode |
select statement | Use of query |
stand by |
not support |
update statement |
Update, insert, modify statement usage |
stand by |
not support |
callble statement |
|
stand by |
stand by |
prepared select statement |
Precompiled query |
stand by |
stand by |
prepared update statement |
Precompile update, modify, insert statements |
stand by |
stand by |
commit |
Content submission in current connection status |
|
|
rollback |
Roll back the contents of the current connection status |
|
|
autocommit(false) |
Indicates that no automatic submission is required |
|
|
-
Add a listener to view the results
You can add viewing result tree and debug sampler to view the results
Database driver class and URL format:
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:@//host:port/service OR jdbc:oracle:thin:@(description=(address=(host={mc-name}) (protocol=tcp)(port={port-no}))(connect_data=(sid={sid}))) |
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:port;databaseName=DBname or jdbc:jtds:sqlserver://localhost:1433/"+"library" |