Hi,
I am using the following approach in designing an application, but I am not
sure whether this is the appropriate way of handling things. Any advice
appreciated.
I have a String body with multiple lines, each line containing a field name
and value.
To use parameters in the SQL, I want to set headers in Camel. I use split
and aggregate to send one line at a time to a route which sets a header,
and in the aggregation, I merge the headers. This allows me to then issue
a SQL call in YAML using the :#${header.x} syntax for multiple fields.
While this works, I am suspicious that I'm taking a long way around and
there is a more straightforward approach. I'm assuming that I need the
values in headers in order to send them in as parameters to a prepared
statement to bypass the possibility of SQL injection.
Am I missing a more straightforward approach, or is this how it's typically
done?
Thanks,
Mitch