camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrea Cosentino (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CAMEL-10154) IN queries with dynamic values failure with multiple headers
Date Mon, 18 Jul 2016 09:08:20 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-10154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrea Cosentino resolved CAMEL-10154.
--------------------------------------
    Resolution: Duplicate

This is already solved in:

https://issues.apache.org/jira/browse/CAMEL-10151

> IN queries with dynamic values failure with multiple headers
> ------------------------------------------------------------
>
>                 Key: CAMEL-10154
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10154
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-sql
>    Affects Versions: 2.17.2
>            Reporter: Fabrizio Spataro
>            Priority: Critical
>              Labels: sql
>
> Hello,
> I am using camel-sql component with IN dynamic parameter and found a bug with a query
with more parameters.
> Summary, in my follow code i use 3 headers: user, company and MyRoles. SQLComponent not
found all my headers.
> If i change my query using ONLY MyRoles header it is go fine!!!
> My Code is:
> {code:xml}
>    <setHeader headerName="CamelSqlQuery">
> 	<constant>SELECT * FROM role where user = :?user and company = :?company and role
IN (:?in:MyRoles)</constant>
>    </setHeader>
>    <to uri="sql://MS?dataSource=mysql" />
> {code}
> Error:
> {quote}
> Caused by: java.sql.SQLException: Number of parameters mismatch. Expected: 3, was: 1
> 	at org.apache.camel.component.sql.DefaultSqlPrepareStatementStrategy.populateStatement(DefaultSqlPrepareStatementStrategy.java:153)
> 	at org.apache.camel.component.sql.SqlProducer$2.doInPreparedStatement(SqlProducer.java:137)
> 	at org.apache.camel.component.sql.SqlProducer$2.doInPreparedStatement(SqlProducer.java:107)
> 	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:629)
> 	... 79 more
> , Out: null: 
> ]
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message