1.下载mysql-connector-java-5.1.31.jar包,放在apache-jmeter-5.0libext目录下
2.数据库驱动类和URL格式:
Datebase |
Driver class |
Database URL |
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 或者 net.sourceforge.jtds.jdbc.Driver |
jdbc:sqlserver://IP:port;databaseName=DBname 或者 jdbc:jtds:sqlserver://localhost:1433/"+"library" |
3.填写数据库:连接池名字、host、port、dbname
4.在JDBC Request 引用连接池名字,填写sql