Test Plan Thread Group JDBC Connection JSR223 Sampler JDBC Request Result Tree
Put codes in the JSR223 Sampler:
int id = Integer.parseInt( vars.get("party_id") ); vars.putObject("id", new Integer(id));
Then use id in JDBC Request:
select * from table where column = ?
Parameter Value: ${id}
parameter Type: NUMBER
It seems the JDBC request is ignored and no output shown in the result tree.
Please help to look into the issue...
Thanks in advance
putObject
method just cast your integer into String usingtoString()
method.vars.putObject("id", id.toString());
– olyv Jan 2 '14 at 6:58select * from table where condition = ${id}
. Supposing your variable has value 5 (it is string, because user defined variable stores only string) next query will be executedselect * from table where condition = 5
. If you need varchar in the SQL query you writeselect * from table where condition = '${id}'
and next will be executedselect * from table where condition = '5'
. JMeter HTTP or JDBC sampler treat ${variable} the next way: just get the text from variable and put it into sampler body. Is it the answer? – olyv Jan 2 '14 at 8:34