How to Compare 2 JDBC response in Jmeter

I want to compare 2 JDBC responses in Jmeter:

I have Source reponse from 1 JDBC request as below in table format:

(Source DB)JDBC Response response1:

src_id1 | src_id2 | src_id3| src_id4 |

10 | 20 | 30 | GBP |

11 | 22 | 31 | USD |

(Target DB)JDBC Reponse 2:

tgt_id1 | tgt_id2 | tgt_id3 | tgt_id4 |

10 | 20 | 30 | GBP |

11 | 22 | 31 | INR |

I am saving the response as String in JDBC Request (in Result Variable Name)

Now how do I compare the values in each column and Print Pass when values match. Fail it when the values do not match.

Number of rows can change.

Need help with assertion code or any other way this can be achieved in Jmeter.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


It sounds like you’re pulling values from a database and want to perform an operation on them with jmeter. I may be misunderstanding, so please correct me if you see that I am. I see jmeter as a load testing application, rather than something that would be ideal for performing operations on database queries.

I believe that the tool you require to compare these values would be something custom coded. I, for example, would probably do it in Python or a bash script because those are my specialties.