jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raihan Jamal <jamalrai...@gmail.com>
Subject Re: Insert JSON String using JMeter to database
Date Wed, 13 Feb 2013 05:50:07 GMT
Thanks for the suggestion. But I am not sure, I understand what you said
just now. Can you provide me an example what changes I need to make in this
JSON string so that I can insert into the Database-

*{"lv":[{"v":{"regId":null,"user":null,"Id":996},"cn":1}],"lmd":1360185}*


By that I will be able to understand much better.

Thanks.


*Raihan Jamal*


On Tue, Feb 12, 2013 at 7:01 PM, Deepak Shetty <shettyd@gmail.com> wrote:

> http://jmeter.apache.org/usermanual/component_reference.html#JDBC_Request
>
> The list must be enclosed in double-quotes if any of the values contain a
> comma or double-quote, and any embedded double-quotes must be doubled-up,
> for example:
>
> "Dbl-Quote: "" and Comma: ,"
>
>
>
>
> On Tue, Feb 12, 2013 at 2:40 PM, Raihan Jamal <jamalraihan@gmail.com>
> wrote:
>
> > I am working on the project in which I need to make a connection to
> > database and insert lot of rows in that Database. I have two columns
> > currently in that database-
> >
> > *    ID                 String PrimaryKey*
> > *    ACCOUNT    String*
> >
> > So I need to insert lot of rows in these two columns with the help of
> > JMeter. I am able to generate random Unique ID for ID column by using
> this-
> >
> > *`${__BeanShell(UUID.randomUUID().toString())}`*
> >
> > I am trying to insert `JSON String` into ACCOUNT columns using `JMeter`.
> > Below is the JSON string that I am trying to insert.
> >
> >
> *`{"lv":[{"v":{"regId":null,"user":null,"Id":996},"cn":1}],"lmd":1360185}`*
> >
> > In the parameter values section in JMeter, I am passing something like
> > this-
> >
> > *    ${__BeanShell(UUID.randomUUID().toString())}
> > ,{"lv":[{"v":{"regId":null,"user":null,"Id":996},"cn":1}],"lmd":1360185}*
> >
> >
> > This is my SQL-
> >
> > *`INSERT INTO TEST2 (id, account) values (?, ?)`*
> >
> >
> > But after trying to insert, I am getting this exception-
> >
> >     Response message: java.io.IOException: Cannot have quote-char in
> plain
> > field:[{"]
> >
> > How can I fix this thing? I just need to insert JSON string in the
> `ACCOUNT
> > column`
> >
> > Any thoughts how to achieve this?
> >
> >
> >
> >
> >
> > *Raihan Jamal*
> >
>

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