camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tomohisa Igarashi (JIRA)" <>
Subject [jira] [Created] (CAMEL-10499) camel-sql - error in multiple dynamic IN replacement
Date Mon, 21 Nov 2016 03:55:58 GMT
Tomohisa Igarashi created CAMEL-10499:

             Summary: camel-sql - error in multiple dynamic IN replacement
                 Key: CAMEL-10499
             Project: Camel
          Issue Type: Bug
          Components: camel-sql
    Affects Versions: 2.18.0
            Reporter: Tomohisa Igarashi
            Assignee: Tomohisa Igarashi

Having this sql
select *
from projects
where project in (:#in:names)
and license in (:#in:licenses)
order by id

and send as following
Map<String, Object> headers = new HashMap<>();
headers.put("names", new String[]{"Camel", "AMQ"});
headers.put("licenses", new String[]{"ASF", "XXX", "YYY"});
template.requestBodyAndHeaders("direct:query", "Hi there!", headers);

causes parameter mismatch
Caused by: java.sql.SQLException: Number of parameters mismatch. Expected: 4, was: 5
        at org.apache.camel.component.sql.DefaultSqlPrepareStatementStrategy.populateStatement(
        at org.apache.camel.component.sql.SqlProducer$2.doInPreparedStatement(
        at org.apache.camel.component.sql.SqlProducer$2.doInPreparedStatement(
        at org.springframework.jdbc.core.JdbcTemplate.execute( ~[spring-jdbc-4.3.4.RELEASE.jar:4.3.4.RELEASE]
        ... 51 more

This message was sent by Atlassian JIRA

View raw message