You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by A577127 <an...@worldline.com> on 2014/07/30 10:52:48 UTC

Camel-jdbc : can't get useHeadersAsParameters working properly

Hi,

I'm trying to send a mysql request thanks to camel-jdbc. However, one of my
fields is a byteArray, so I would like to use named parameters to bind some
value to a header (which can be a byteArray).

According to the  camel-jdbc documentation
<http://camel.apache.org/jdbc.html>  , I should set "useHeadersAsParameters"
to true on my endpoint.
Then, according to the example given in the documentation :

I should set headers and reference them with the syntax ":?headername". I
tryed this, but in the end it is replaced by "?" in my request.

Then, the doc states about the "CamelJdbcParameters" header :
/A java.util.Map which has the headers to be used if useHeadersAsParameters
has been enabled./

I tryed this also (I created a HashMap<String, Object> containing a dummy
String value), and got the same problem : it is replaced by "?" in the
query.

I will take a look at how stuff gets processed in the camel-jdbc component,
but maybe I'm doing something wrong. Thanks.

(by the way, there's a typo "CamelJdbcParametes")

Here is the query I used :





--
View this message in context: http://camel.465427.n5.nabble.com/Camel-jdbc-can-t-get-useHeadersAsParameters-working-properly-tp5754625.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel-jdbc : can't get useHeadersAsParameters working properly

Posted by A577127 <an...@worldline.com>.
I'm using the latest version (2.13.2).

I solved my problem. I replaced this :

By this :


The application_id (String) is correctly sent to MySQL. I need to check for
the certificate (which is byte[]), but I guess it's all good.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-jdbc-can-t-get-useHeadersAsParameters-working-properly-tp5754625p5754645.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel-jdbc : can't get useHeadersAsParameters working properly

Posted by Arnaud Deprez <ar...@gmail.com>.
Hi,

Can you tell us which camel version do you use and show us your route
please ?


2014-07-30 10:52 GMT+02:00 A577127 <an...@worldline.com>:

> Hi,
>
> I'm trying to send a mysql request thanks to camel-jdbc. However, one of my
> fields is a byteArray, so I would like to use named parameters to bind some
> value to a header (which can be a byteArray).
>
> According to the  camel-jdbc documentation
> <http://camel.apache.org/jdbc.html>  , I should set
> "useHeadersAsParameters"
> to true on my endpoint.
> Then, according to the example given in the documentation :
>
> I should set headers and reference them with the syntax ":?headername". I
> tryed this, but in the end it is replaced by "?" in my request.
>
> Then, the doc states about the "CamelJdbcParameters" header :
> /A java.util.Map which has the headers to be used if useHeadersAsParameters
> has been enabled./
>
> I tryed this also (I created a HashMap<String, Object> containing a dummy
> String value), and got the same problem : it is replaced by "?" in the
> query.
>
> I will take a look at how stuff gets processed in the camel-jdbc component,
> but maybe I'm doing something wrong. Thanks.
>
> (by the way, there's a typo "CamelJdbcParametes")
>
> Here is the query I used :
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-jdbc-can-t-get-useHeadersAsParameters-working-properly-tp5754625.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>