Return-Path: X-Original-To: apmail-jakarta-jmeter-user-archive@www.apache.org Delivered-To: apmail-jakarta-jmeter-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4873F4706 for ; Sat, 4 Jun 2011 08:42:47 +0000 (UTC) Received: (qmail 94370 invoked by uid 500); 4 Jun 2011 08:42:46 -0000 Delivered-To: apmail-jakarta-jmeter-user-archive@jakarta.apache.org Received: (qmail 94342 invoked by uid 500); 4 Jun 2011 08:42:46 -0000 Mailing-List: contact jmeter-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "JMeter Users List" Reply-To: "JMeter Users List" Delivered-To: mailing list jmeter-user@jakarta.apache.org Received: (qmail 94333 invoked by uid 99); 4 Jun 2011 08:42:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Jun 2011 08:42:45 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of shettyd@gmail.com designates 74.125.83.44 as permitted sender) Received: from [74.125.83.44] (HELO mail-gw0-f44.google.com) (74.125.83.44) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Jun 2011 08:42:40 +0000 Received: by gwb20 with SMTP id 20so1344117gwb.31 for ; Sat, 04 Jun 2011 01:42:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=PTgdV6z2qJCqkH9Ca9l2NWO/mbW/v842YubCv26ao9g=; b=nUkpYYPqFbqLZX+u3jsdQSBazg08BjhSxr7h+LpzcHgh8iYpPI0MAv3K5L4OX2uTzz LR68RG7pVWJz7TnBcc7hk7viISXA/XQOfNC7O2SpWrohVjowr/JiVC4EPnNH9c7DtrnT VNBUoI7uBvPpLW/2de+dS1iFowpVfVO2xQ+Qc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=i0Gdi9GEVqaSSrt5y20JMDgHSdPc27dsDNzU9wK8bkHogHhFXDS5oRWq+enGis3Hgc 0KFgO2UL8U4TSaqfQVtmlw0eU7bBGZFSQvY5hWQ2LNiPpmbT0TgkeyFsySjofqzYWpxH Q41HYxB/rSpWt/ADD/c+lfjiff1rlE+RfNv6w= MIME-Version: 1.0 Received: by 10.150.252.16 with SMTP id z16mr2487451ybh.345.1307176938502; Sat, 04 Jun 2011 01:42:18 -0700 (PDT) Received: by 10.151.79.9 with HTTP; Sat, 4 Jun 2011 01:42:18 -0700 (PDT) In-Reply-To: <1307175999890-4453447.post@n5.nabble.com> References: <1307175999890-4453447.post@n5.nabble.com> Date: Sat, 4 Jun 2011 01:42:18 -0700 Message-ID: Subject: Re: Using values from DB for a HTTP request From: Deepak Shetty To: JMeter Users List Content-Type: multipart/alternative; boundary=000e0cd6d10813fcdd04a4ded93a --000e0cd6d10813fcdd04a4ded93a Content-Type: text/plain; charset=ISO-8859-1 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 +Threadgroup ++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. username,password ++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. regards deepak 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: > http://jmeter.512774.n5.nabble.com/Using-values-from-DB-for-a-HTTP-request-tp4453447p4453447.html > Sent from the JMeter - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org > > --000e0cd6d10813fcdd04a4ded93a--