jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <>
Subject Re: Using values from DB for a HTTP request
Date Sat, 04 Jun 2011 08:42:18 GMT
the simple answer is to use a CSV file instead (Im assuming eventually you
will want to run your test with multiple threads and this user name will
vary per thread).

Then you simply use the CSV Data Set config . In the variable name field you
specify say username,password (number of variables is same as number of
columns in your CSV) and in your HTTP request you use ${username} and
${password} wherever you want to post the value.
various comments in the mail archives describe this

You can ofcourse use various techniques to generate this CSV (including
generating it from within Jmeter, but usually this is done outside the test)

If you still wanted to answer your original question then
++JDBC Connection Configuration (db settings, datasource name)
++JDBC Request Sampler (uses above datasource, in the variable names field
specify any names (number should be same as columns returned by sql - e.g.
++Debug Sampler (to validate what is being returned , you can remove once
you get it working
++HTTP Sampler (use ${username} and ${password} for parameter values -
assuming only 1 row is returned
+View Results tree listener

if you database stores password in anything other than a one way salted hash
then you have a serious security risk.


On Sat, Jun 4, 2011 at 1:26 AM, pavelz <> wrote:

> Hi guys, I'm a n00b here so I'd really appreciate your help on some small
> thing:
> I need to extract from DB a user and a password in order to pass them as
> parameters within HTTP request.
> For some reason what I do at the moment I fail miserably.
> Many thanks in advance!
> Pavel
> --
> View this message in context:
> Sent from the JMeter - User mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message