Hi Claus
Thank you for the quick response.
aside from mybatis or velocity , I understand it wouldn't be possible
with the xpath language?
if I had a java bean in my queue I could do it with the in.body language
right?

Thanks.

On 03/01/12 19:52, Claus Ibsen-2 [via Camel] wrote:
> Hi
>
> Just use a java bean and use java code to build the SQL.
> Or a template language such as velocity / freemarker.
>
> But often a java bean can do the trick in 5 lines of code.
>
> For more complicated SQL, then MyBatis have a java based SQL builder
> which looks cool.
> They also offer a XML templates to build dynamic queries. Its worth a
> look if you have a fair amount of SQL work to do.
> http://www.mybatis.org/
>
> And there is a Camel component for it as well
> http://camel.apache.org/mybatis
>
>
> On Thu, Mar 1, 2012 at 6:17 PM, shin938 <[hidden email]
> </user/SendEmail.jtp?type=node&node=5528645&i=0>> wrote:
>
> > Hi
> > I created a route in servicemix that sends pax loging events to a
> queue and
> > transforms them to xml into another queue.
> > now i want a route that builds a sql insert from the xml payloads,
> but I
> > can't figure out the way to do that.
> >
> > I think I want something like that if it was  possible:
> > <route>
> >            <from uri="activemq:logsxmlqueue"/>
> >            <setBody>
> >                    <simple>insert into log_table
> > values(xpath(//level),xpath(//category),xpath(//message))  </simple>
> >            </setBody>
> >            <to uri="jdbc:mysqldb"/>
> >  </route>
> >
> > Thank you for any help.
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/how-to-build-a-sql-insert-route-from-xml-payload-tp5528543p5528543.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> -- 
> Claus Ibsen
> -----------------
> FuseSource
> Email: [hidden email] </user/SendEmail.jtp?type=node&node=5528645&i=1>
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the
> discussion below:
> http://camel.465427.n5.nabble.com/how-to-build-a-sql-insert-route-from-xml-payload-tp5528543p5528645.html
>
> To unsubscribe from how to build a sql insert route from xml payload,
> click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5528543&code=c2hhbG9tOTM4QGdtYWlsLmNvbXw1NTI4NTQzfDExMDc1ODU2NDM=>.
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-build-a-sql-insert-route-from-xml-payload-tp5528543p5528724.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to