title: Camel Blueprint specify parameter for prepared sql statement
body: <p>I have a poll enrich which enriches a POJO with the result of an SQL query (from a MySQL database). It currently gets the brand from the POJO and then gets the name from the order matching the brand. I had to add quotes around the ${body.getBrand}, else the query would look for a column with the brand name instead of using the value. Currently it looks like this:</p>
  
  <pre><code>&lt;pollEnrich id="_enrich1" strategyRef="merge" timeout="5000"&gt;
      &lt;simple&gt;sql:SELECT name FROM orders WHERE brand= '${body.getBrand}'&lt;/simple&gt;
  &lt;/pollEnrich&gt;
  </code></pre>
  
  <p>I want to change it because I'll probably need to create more sql queries and the current version does not work if the value contains quotes and thus is vulnerable to sql injection.</p>
  
  <p>I thought prepared statements would do the trick and wanted to use a named parameter but I do not seem to be able to set the value of the parameter.</p>
  
  <p>I have tried many different things like for example setting a header and change the query to have a named parameter:</p>
  
  <pre><code>&lt;setHeader headerName="brand" id="brand"&gt;
      &lt;simple&gt;${body.getBrand}&lt;/simple&gt;
  &lt;/setHeader&gt;
  &lt;pollEnrich id="_enrich1" strategyRef="merge" timeout="5000"&gt;
      &lt;simple&gt;sql:SELECT name FROM orders WHERE brand= :#brand&lt;/simple&gt;
  &lt;/pollEnrich&gt;
  </code></pre>
  
  <p>but I keep getting </p>
  
  <blockquote>
    <p>PreparedStatementCallback; bad SQL grammar [SELECT name FROM orders WHERE brand= ?]; nested exception is java.sql.SQLException: No value specified for parameter 1</p>
  </blockquote>
  
  <p>I have also tried setting the useMessageBodyForSql option to true (since this seemed like something that might help?) but nothing I have tried seemed to work.</p>
  
  <p>I have seen a lot of examples/solutions for people setting the routes with java, but I assume there must also be a solution for the blueprint xml?</p>
  
  <p>If anyone got any suggestion or example that would be great.</p>