Hi

You need to use named parameters in the sql, where you can use body to
refer to the body fields
http://camel.apache.org/sql-component

.to("sql:insert into orders (id, item, processed) values
(:#${body.id}, :#${body.item}, false)")

On Tue, Jul 14, 2015 at 10:49 PM, vivekrao001 <vivekrao...@gmail.com> wrote:
> Hi,
>
> I'm successfully reading queue and parsing it into bean using bindy. But
> next I need to insert in to db. What ever the expression I use, it giving
> some error. Could some body help in forming the expression for the value
> parameter.
> -------------
> BodyType            com.myapp.vivek.component.Order
> Body                   Order [id=11, item=ww]
> ----------
>
> @Component
> public class ReadMq extends SpringRouteBuilder {
>
>         @Override
>         public void configure() throws Exception {
>                 from("jms:queue:TestQueueOne")
>                                 .routeId("QueueListener")
>                                 .log("Queue Message :${body}")
>                                 .unmarshal()
>                                 .bindy(BindyType.Fixed, Order.class)
>                                 .log("Queue Message : ${body} :: order number 
> ${body.id}")
>                                 .to("sql:insert into orders (id, item, 
> processed) values (*#*, *#*,
> false)")
>                                 .end();
>         }
>
> }
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-Insert-after-ready-Fixed-length-message-from-queue-tp5769316.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition: http://www.manning.com/ibsen2

Reply via email to