You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by waseemfa <fa...@gmail.com> on 2011/11/16 13:01:13 UTC

How to query the database and save the results to a csv files

Hi,

I have a scenario where i have to query a db and save the results into a
.csv file and use the same file as teh data file.

How do i do this using JMeter

Thanks for the help in advance

-Waseem

--
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-query-the-database-and-save-the-results-to-a-csv-files-tp4997493p4997493.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: How to query the database and save the results to a csv files

Posted by Oliver Lloyd <ol...@hotmail.com>.
Add a Regular Expression Extractor.

-----
http://www.http503.com/
--
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-query-the-database-and-save-the-results-to-a-csv-files-tp4997493p5007530.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: How to query the database and save the results to a csv files

Posted by Shirish <sh...@gmail.com>.
Hi,

@Oliver: I used the DBC Request Sampler and fired a select query with a
variable, can you suggest me if my JDBC Request Sampler got successfully
executed how to extract and use the values in my test plan for further
execution.

Shirish
On Fri, Nov 18, 2011 at 5:26 PM, Oliver Lloyd <ol...@hotmail.com>wrote:

> Are you saying that you have a requirement to only use a csv file with
> JMeter? That seem unlikely.
>
> If not, then why don't you want to use a database? Try using the JDBC
> Request Sampler - it's really very simple. If you really, really only want
> to use a comma delimited text file, then sure, you could use beanshell
> processors to write some code that will read and write from such a file but
> I suspect you'll find using a database a lot easier.
>
> Generally, if you have strange requirements that limit the possible
> solutions to your problem then it is probably a good idea to list them -
> makes sense, no?
>
> -----
> http://www.http503.com/
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/How-to-query-the-database-and-save-the-results-to-a-csv-files-tp4997493p5004071.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: How to query the database and save the results to a csv files

Posted by Oliver Lloyd <ol...@hotmail.com>.
Are you saying that you have a requirement to only use a csv file with
JMeter? That seem unlikely.

If not, then why don't you want to use a database? Try using the JDBC
Request Sampler - it's really very simple. If you really, really only want
to use a comma delimited text file, then sure, you could use beanshell
processors to write some code that will read and write from such a file but
I suspect you'll find using a database a lot easier.

Generally, if you have strange requirements that limit the possible
solutions to your problem then it is probably a good idea to list them -
makes sense, no?

-----
http://www.http503.com/
--
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-query-the-database-and-save-the-results-to-a-csv-files-tp4997493p5004071.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: How to query the database and save the results to a csv files

Posted by waseemfa <fa...@gmail.com>.
But my requriments are in such a way tht i cant do.

Can my problem be achieved using a sampler?



--
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-query-the-database-and-save-the-results-to-a-csv-files-tp4997493p5003276.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: How to query the database and save the results to a csv files

Posted by Oliver Lloyd <ol...@hotmail.com>.
A better method might be to use a database; this will allow multiple threads
to read and write from the same data without the locking problems you could
well hit when trying to do the same thing using a text file.

Or, if you only need to pass data within the same thread context then just
use variables.

Or, pre-process the data before the test.

All of these are better ideas compared to trying to read and write to a CSV
file using multiple threads all  running at the same time.

-----
http://www.http503.com/
--
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-query-the-database-and-save-the-results-to-a-csv-files-tp4997493p4997527.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org