I am trying to insert into sql using a bean in Camel. I must be missing a detail somehow, since the sql is null when reaching the camel sql components inner classes. Should it not be enough to return the map in the insertBean?
My route is defined like this.
transform().method(InsertFxBean.class).toF("sql:%s",insertQuery);
My insertBean only generates a string, object map and return it.
class InsertBean {
public Map<String, Object> generateInsert(final Exchange exchange) throws Exception {
Map<String, Object> map = exchange.getIn().getBody(Map.class);
map.put("username", value);
//add more stuff, using
//namedParameters here
return map;
I have followed the camel apache sql example
I also have tried setting different option parameters on the sql component, like useMessageBodyForSql
, and batch, with no different outcome.
stackTrace shows sql is emtpy:
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-02289: sequence does not exist
Thanks in advance