Yep, I did extraction from JDBC sampler and put it into CSV with "Save
response to a file" Listener + a post processor to remove first line:

//Removing first line (column names) of results
String result;
result = prev.getResponseDataAsString();
removeString = "CONCAT(name, '/', id)\n";
rlen = removeString.length();

result = result.substring(rlen,result.length() - rlen);
prev.setResponseData(result);


Best,
Shmuel.


On Thu, Jun 21, 2012 at 7:03 PM, sebb <[email protected]> wrote:

> On 21 June 2012 16:27, Roderick Parks <[email protected]>
> wrote:
> > I've recently developed a prototype JDBC Data Set component that is
> > analogous to the CSV Data Set except that the values come from the
> > columns in the select or prepared select statement. It uses JDBC
> > Connection Configuration just like the JDBC sampler, pre-processor and
> > post-processor.
>
> It would be likely more efficient to extract the variables into a CSV
> file just before running the test.
> Of course that may not be quite as convenient, and would not work if
> the values are dynamic.
>
> > Early on I thought that keep alive and connection age could be
> > significant parameters affecting the performance and efficiency of my
> > component but when I looked in the source code for the JDBC Connection
> > (src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/config/DataSourceElem
> > ent.java) I found not only that "Keep-Alive", "Max Connection Age" and
> > "Validation Query" have set/get methods but are otherwise not used
> > (presumably an aspirational addition to the component and its beaninfo)
> > but also that it uses the now defunct Apache Excalibur as its actual
> > JDBC interface: it's only a wrapper.  Rather than dig into another
> > source project, and a dead and static one at that, I decided to trust
> > JMeter's JDBC Connection Configuration's encapsulation of Excalibur and
> > hope that the eventually inevitable migration to something else remains
> > equally encapsulated and won't break my component.
> >
> > So that's the long answer. The short answer is that you have no control
> > over the status of a given connection and will have to tolerate the
> > default behaviour.
>
>
> > -----Original Message-----
> > From: Dzmitry_Kashlach [mailto:[email protected]]
> > Sent: 21 June 2012 15:08
> > To: [email protected]
> > Subject: Re: How to connect to Database from JMeter at the start of the
> > test and use the connection in the post processor to insert some data?
> >
> >  When I had task that was similar to yours, I opened connection to
> > database
> > via JDBC Connection Configuration once per Thread Group. After that I
> > used
> > this connection through the whole test. While creating
> > JMeter test-plan, I used
> > http://community.blazemeter.com/knowledgebase/articles/65143-using-jdbc-
> > sampler-in-jmeter-2-6
> > How to use JDBC Sampler in JMeter
> >
> > --
> > View this message in context:
> > http://jmeter.512774.n5.nabble.com/How-to-connect-to-Database-from-JMete
> > r-at-the-start-of-the-test-and-use-the-connection-in-the-post-p-tp567638
> > 8p5713661.html
> > Sent from the JMeter - User mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to