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 <shalom...@gmail.com> 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: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to