在Camel路由中执行预准备语句时的SQLException

时间:2017-11-30 17:17:20

标签: apache-camel

我有以下Camel路由定义。其目的是将Informix中的一些记录导出为CSV。

<route id="out">
  <from uri="timer:foo?repeatCount=1" />
  <to uri="sql:select nro_service, enviado_sap ,estado_transmision from servicio_cab?dataSource=dataSource" />
  <to uri="bean:com.enelint.pangeaenelist.Transformer?method=tocsv(Exchange)" />
  <log message="${body}" />
</route>

我从Informix收到以下错误:

堆栈跟踪

org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [select nro_servicio, enviado_sap ,estado_transmision from servicio_cab]; SQL state [IX000]; error code [-79782]; Method can be called only once.; nested exception is java.sql.SQLException: Method can be called only once.
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)

内部异常是java.sql.SQLException: Method can be called only once。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

骆驼2.12报道的问题已得到修复;更新到Camel版本2.20.1就可以了。谢谢你的帮助。