Hi Tom! I don't think the component "camel-jdbc" supports any other type of named parameter other than :?name. Looking at the code (DefaultJdbcPrepareStatementStrategy) we see:
protected boolean hasNamedParameters(String query) { NamedQueryParser parser = new NamedQueryParser(query); return parser.next() != null; } This validation uses the inner class NamedQueryParser that has a fixed pattern regex compilation: private static final Pattern PATTERN = Pattern.compile("\\:\\?(\\w+)"); That put, I don't think the JIRA you mentioned are related to the requirement you wish for. I suggest to use other approach: (a) take a look at camel-sql or; (b) implement your own JdbcPrepareStatementStrategy extending the default one. To use your own strategy, add your implementation to the Registry (if using Spring, the context) and configure it on your rote by setting the *prepareStatementStrategy* property [0]. You might open a JIRA for this requirement also if you wish. Best Regards, [0] - https://github.com/apache/camel/blob/master/components/camel-jdbc/src/main/docs/jdbc-component.adoc Zanini Zanini On Sat, Mar 31, 2018 at 9:14 PM, Tom Oehser <t...@toms.net> wrote: > Not camel SQL, camel JDBC. > > The URL is jdbc: not sql:, and the named-placeholder is :? not :#. > > There is a comment made by Claus Ibsen that it _DOES_ support it: > > See: https://issues.apache.org/jira/browse/CAMEL-6157 at the end... > > Claus Ibsen <https://issues.apache.org/jira/secure/ViewProfile.jspa?name > =davsclaus> added a comment - 02/Jun/13 15:23 > > Thanks for your contribution. I polished the patch a bit and made it > work with non named parameters, eg just using ? as well. > > So... > > Besides, I can't just change the SQL to use :?name instead of ? - the > point is to be able to share the SQL from the same Nexus/Git source between > this and _other_ programs that don't support a special template syntax. > > Given that I found the note that it _is_ supported (in jdbc: - camel-jdbc > - not sql: - camel-sql - if I understand correctly...)... > > I think my question has become "is it documented _how_ to use the feature > that I see in the comment is supported... It doesn't seem to be > _documented_ other than in the patch note above... > > -Tom > > > On 03/31/2018 07:34 PM, Miguel Ruiz Velasco Sobrino wrote: > >> Hi Tom, >> Camel JDBC component (camel-sql) only supports named parameters for one >> reason:You specify both the place of the parameter AND the source of the >> value (name of header or key of body).The placeholder camel-sql is :# >> If you really want to support plain old ? JDBC placeholders, you will >> need to write a custom Processor. My advice is to change your SQL query to >> use the camel mechanism (:#) >> >> >> Miguel Ruiz Velasco SobrinoFCM Computación Mexicana >> >> >> -------- Mensaje original --------De: Tom Oehser <t...@toms.net> Fecha: >> 30/3/18 13:58 (GMT-06:00) A: users@camel.apache.org Asunto: Fwd: jdbc: >> with non-named parameter? >> >> >> Hey - trying to share some SQL between a Camel jdbc: app and a Spring >> jdbc-template app... >> >> the SQL is like >> >> "blah blah ? blah blah" >> >> - can't figure out how to get camel jdbc: to support the ? (regular >> non-named) parameter. >> >> I see the named parameter support - I could change the SQL - >> >> but - >> >> it looks like camel uses :?name and spring jdbc templates use :name >> (different named parameter syntax). >> >> So... is there a way to support the regular ? parameter in camel jdbc: ??? >> >> >