jmeter数据库连接配置

一、实际试过的mysql配置

1、导入一个JDBC jar包(我是直接把jar包放在了jmeter的lib目录),包:mysql-connector-java-5.1.7-bin.jar

2、设置JDBC Connection Configuration数据库连接:

1)Database URL(数据库url):jdbc:mysql://ip:3306/bugfree?allowMultiQueries=true

2)JDBC Driver class(数据库驱动):com.mysql.jdbc.Driver(注:就是指连接什么类型的数据库,mysql、oracle、SqlServer等)

3)Username:登录数据库的用户名

4)Password:登录数据库的用户的密码

二、关于oracle配置

jmeter帮助文档建议配置:jdbc:oracle:thin:@//host:port/service 

由于没有实际试过,网上查到的oracle数据库url配置:jdbc:oracle:thin:@ip:1521:DatabaseName

三、坑

1、注意url、username、password等是否存在空格。

2、Variable Name:数据库连接池的名称,jdbc request中通过这个名称选择连接池使用。(注:可有多个jdbc connection configuration,每个起不同的名称。jmeter帮助中的描述The name of the variable the connection is tied to。Each name must be different。......)

猜你喜欢

转载自www.cnblogs.com/xuexizongjie/p/10597770.html