${__BeanShell(vars.getObject("数据库返回参数名称").get(${__intSum(${index},-1)}).get("method"))}
__BeanShell是jmeter内部函数入口
vars.getObject可以获取到jmeter定义的变量对象(如数据库返回参数名称)
数据库的获取方式${__BeanShell(vars.getObject("param").get(n).get("colname"))},获取参数param,数据库第n行,列名为colname
__intSum(a,b)获取一个数据的计算求和值
数据库获取第一行下标是从0开始的,但一般我们取值会默认设置1作为开始,所以这里我们做了一个处理,把我们设置的值减1,让他从0开始计数。从列取值要指定列名
${index}是设定我们要取数据表中的第几行的值,可以控制获取数据行(使用csv data set config)