[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: jdbc: with non-named parameter?


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 <Tom@xxxxxxxx> Fecha: 30/3/18  13:58  (GMT-06:00) A: users@xxxxxxxxxxxxxxxx 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: ???