Abhiram
Abhiram

Reputation: 75

JMeter JDBC Prepared Statements not binding variables

I am working on JMeter with JDBC samplers. I have created the sampler with query type as Prepared Select Statement. I am using MySQL 5.5.

I have written a Select statement in the Query section. The parameters are mentioned in the Parameter values section along with their respective types in the Parameter types section. The parameters are fetched from a CSV file.

I ran the query and verified the results from View Result Tree listener. I am getting expected result. When I run my tests in multi threaded/ multi iteration mode, the results are satisfactory from the data retrieval perspective, however, from the Mysql log files, I found that instead of just setting the binding variables and executing the query, entire query was executed again as if it was as simple select statement.

It gives me an impression that though I have selected Prepared Select Statement as query type, it was executing the query as simple select statement.

Has anybody encountered this issue? What are the areas where I can look to resolve this issue? Configuration for my DB samplers

DB Sampler Info

Upvotes: 2

Views: 1471

Answers (1)

UBIK LOAD PACK
UBIK LOAD PACK

Reputation: 34566

From what you show, for me JMeter is using PreparedStatements so binding is occuring.

What log in MySQL makes you think that binding is not occuring ? Are you sure that only JMeter is hitting MySQL ?

Could you set in user.properties:

log_level.jmeter.protocol.jdbc=DEBUG

Restart and show jmeter.log

JMeter is working fine, read this:

So change in the JDBC Connection Configuration the property "Database URL" to include :

?useServerPrepStmts=true

Upvotes: 0

Related Questions