1 Reply Latest reply on Jan 3, 2014 9:40 AM by Keith Babo

    dynamic query using camel JPA binding

    Harish T Newbie

      Hi,

       

      I have referred switchyard quick start example to persist and query db entities which worked fine.

       

      <sca:reference name="QueryService" multiplicity="0..1" promote="DatalayerServiceBean/QueryService">

            <sca:interface.java interface="com.nielsen.engineering.mediaworks.service.query.QueryService"/>

            <sql:binding.sql>

              <operationSelector operationName="queryDb"/>

        <sql:contextMapper/>

              <sql:query>SELECT * FROM Table1</sql:query>

              <sql:dataSourceRef>java:jboss/datasources/mmds</sql:dataSourceRef>

            </sql:binding.sql>

          </sca:reference>

       

      in above switchyard.xml extract sql:query is hardcoded in configuration file. I want to test how to send sql query dynamically. Do we have any place holder for sql query ? or is their any way to set the sql:query element dynamically from java class ?

       

      Kindly direct me to some example where we do

      1. updating specific db column in a table,

      2. Sending sql query dynamically

       

      Thanks in Advance..