1、在使用 jdbc request之前需要加载一个jar包

在test plan中将jar包引入到classpath中

2、创建一个JDBC Connection Configuration

Variable Name: 变量名称,需要变量名绑定到池。需要唯一标识。与JDBC取样器中的相对应,决定JDBC取样的配置。简单理解就是在JDBC request的时候确定去哪个绑定的配置。

MaxNumber of Connection: 数据库最大链接数

PoolTimeout: 数据库链接超时,单位ms

Idle Cleanup Interval (ms): 数据库空闲清理的间隔时间,单位ms

Auto Commit:自动提交。有三个选项,true、false、编辑(自己通过jmeter提供的函数设置)

Transaction Isolation:

事务间隔级别设置,主要有如下几个选项:(对JMX加解密)

TRANSACTION_REPEATABLE_READ事务重复读、TRANSACTION_READ_COMMITTED事务已提交读 、TRANSACTION_SERIALIZABLE事务序列化 、TRANSACTION_READ_UNCOMMITTED事务未提交读、TRANSACTION_NODE  事务节点 、DEFAULT默认、编辑

Keep-Alive: 是否保持连接

Max  Connection age (ms):最大连接时长,超过时长的会被拒绝

Validation Query:验证查询,检验连接是否有效(数据库重启后之前的连接都失效,需要验证查询)

Database URL:如jdbc:mysql://localhost:3306/test

表示本地数据库,3306端口,数据库名称为test

JDBCDriver Class: JDBC的类,如org.gjt.mm.mysql.Driver

3、创建  sampler - >jdbc request

variable 需要填写的内容与前面的 variable name bound to pool 的内容一致

Query Type- Set this according to the statement type: 
• Select Statement
• Update Statement - use this for Inserts and Deletes as well
• Callable Statement
• Prepared Select Statement
• Prepared Update Statement - use this for Inserts and Deletes as well
• Commit
• Rollback
• Autocommit(false)
• Autocommit(true)
• Edit - this should be a variable reference that evaluates to one of the above

Parameter values : 参数

Parameter types- Comma-separated list of SQL parameter types (e.g. INTEGER, DATE, VARCHAR, DOUBLE)

Variable Names- Comma-separated list of variable names to hold values returned by Select statements, Prepared Select Statements or CallableStatement. Note that when used with CallableStatement, list of variables must be in the same sequence as the OUT parameters returned by the call. If there are less variable names than OUT parameters only as many results shall be stored in the thread-context variables as variable names were supplied. If more variable names than OUT parameters exist, the additional variables will be ignored.

Result Variable Name- If specified, this will create an Object variable containing a list of row maps. Each map contains the column name as the key and the column data as the value. Usage:
columnValue = vars.getObject("resultObject").get(0).get("Column Name");

如果使用了select 结果有多条记录,需要对其中的某个结果进行操作:

将结果存储在result中,result是以一个map形式进行的存储,需要对其中的某个数据进行操作的时候,可以在后面使用beanshellprocessor

上面的columnvalue就存储了某些数据,可以作为变量进行使用  如:${columnValue}

http://www.cnblogs.com/yingchen/p/5124838.html

第二种方法使用:

A,B,C对应的是上面sql查出来的三个字段

使用方法,在其他地方使用  ${A_#},${A_1},${A_2}分别表示,行数, 第一列,第一行,第一列第二行。

jmeter jdbc request使用详解的更多相关文章

  1. Jmeter JDBC Request 使用详解

    本篇博文讲解以MySQL为例,搞懂JDBC Request中MySQL的使用方法,换成其它数据库, 如Oracle.PSQL也会很容易上手. 一.基本配置 1.首先我们先了解一下,不同数据库的驱动类和 ...

  2. Jmeter 正则表达式提取器详解(Regular Expression Exactor)

    Jmeter 正则表达式提取器详解(Regular Expression Exactor) Name(名称):随意设置,最好有业务意义. Comments(注释):随意设置,可以为空 Apply to ...

  3. request.getcontextPath() 详解

    request.getcontextPath() 详解 文章分类:Java编程 <%=request.getContextPath()%>是为了解决相对路径的问题,可返回站点的根路径. 但 ...

  4. IIS负载均衡-Application Request Route详解第四篇:使用ARR实现三层部署架构(转载)

    IIS负载均衡-Application Request Route详解第四篇:使用ARR实现三层部署架构 系列文章链接: IIS负载均衡-Application Request Route详解第一篇: ...

  5. IIS负载均衡-Application Request Route详解第二篇:创建与配置Server Farm(转载)

    IIS负载均衡-Application Request Route详解第二篇:创建与配置Server Farm 自从本系列发布之后,收到了很多的朋友的回复!非常感谢,同时很多朋友问到了一些问题,有些问 ...

  6. IIS负载均衡-Application Request Route详解第一篇: ARR介绍(转载)

    IIS负载均衡-Application Request Route详解第一篇: ARR介绍 说到负载均衡,相信大家已经不再陌生了,本系列主要介绍在IIS中可以采用的负载均衡的软件:微软的Applica ...

  7. django中request对象详解(转载)

    django中的request对象详解 Request 我们知道当URLconf文件匹配到用户输入的路径后,会调用对应的view函数,并将  HttpRequest对象  作为第一个参数传入该函数. ...

  8. jmeter—JDBC request动态参数设置

    jmeter—JDBC request动态参数设置 重要参数说明: Variable Name:数据库连接池的名字,需要与JDBC Connection Configuration的Variable ...

  9. IIS负载均衡-Application Request Route详解第一篇: ARR介绍

    IIS负载均衡-Application Request Route详解第一篇: ARR介绍 说到负载均衡,相信大家已经不再陌生了,本系列主要介绍在IIS中可以采用的负载均衡的软件:微软的Applica ...

随机推荐

  1. C#联合Union的实现方式

    一.基础篇 C#不像C++,他本身是没有联合Union的,但是可以通过手动控制结构体每个元素的位置来实现,这需要结合使用StructLayoutAttribute.LayoutKind以及FieldO ...

  2. Python将Excel生成SHP

    #!/usr/bin/env python # -*- coding: utf-8 -*- import gdal import xlrd import shapefile # open the ex ...

  3. 通过API找出Autodesk Vault中某个用户组可以访问的Vault

    首先在Vault Explorer中可以这样查看和更改某个用户组有权访问的vault Tools –> Administration –> Global Settings –> Gr ...

  4. Tomcat系统部署启动问题分析一例[sudo 启动]

    今天的系统获取新的版本后部署时突然tomcat无法启动,而比较版本的变化内容,也就是几个jsp和js文件的变化,对于web.xml等都没有调整. 这个问题很是奇怪,下面把步骤总结一下,以避免类似的问题 ...

  5. Thoughts on an Article from Science 'A network framework of cultural history'

    Apparently, this is an excellent interdisciplinary study. This paper drawn on a simple but large dat ...

  6. Sharepoint学习笔记—习题系列--70-576习题解析 -(Q95-Q98)

    Question  95  Your development team has asked you to help them determine the cause of an error in a ...

  7. JavaScript学习09 函数本质及Function对象深入探索

    JavaScript学习09 函数本质及Function对象深入探索 在JavaScript中,函数function就是对象. JS中没有方法重载 在JavaScript中,没有方法(函数)重载的概念 ...

  8. 【代码笔记】iOS-浮动的云

    一,效果图. 二,工程图. 三,代码. RootViewController.h #import <UIKit/UIKit.h> @interface RootViewController ...

  9. django 微信企业号 返回text消息

    from django.template import Context,Template textTemplate=""" <xml> <ToUserN ...

  10. JS获取浏览器名和版本信息

    Navigator 对象包含有关浏览器的信息. Navigator 对象属性和方法: <html> <head> <title>JS完整获取浏览器信息</ti ...