camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From contactreji <contactr...@gmail.com>
Subject Camel SQL component - Insert Operation
Date Thu, 13 Nov 2014 19:03:23 GMT
Hi 

I am trying to insert a record into the camel database. I have no errors
when I hard code the value like *<to uri="sql:INSERT INTO testtable VALUES
('Samson')" />*


I was wondering  why I get following error when I have following camel
Spring DSL line

*<setHeader headerName="data">
	<constant>Samson</constant>
</setHeader>
<to uri="sql:INSERT INTO testtable VALUES (#:data)" />*


*org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback;
bad SQL grammar [INSERT INTO testtable VALUES (?:data)]; nested exception is
java.sql.SQLException: No value specified for parameter 1
	at
org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:98)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
	at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
	at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
	at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
	at
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
	at
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
	at
org.apache.camel.component.sql.SqlProducer.process(SqlProducer.java:48)[camel-sql-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:81)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.Pipeline.process(Pipeline.java:117)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:135)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:63)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at java.util.TimerThread.mainLoop(Timer.java:555)[:1.7.0_45]
	at java.util.TimerThread.run(Timer.java:505)[:1.7.0_45]
[mel-1) thread #0 - timer://foo] TimerConsumer                  WARN  Error
processing exchange. Exchange[Message: [Body is null]]. Caused by:
[org.springframework.jdbc.BadSqlGrammarException -
PreparedStatementCallback; bad SQL grammar [INSERT INTO testtable VALUES
(?:data)]; nested exception is java.sql.SQLException: No value specified for
parameter 1]
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback;
bad SQL grammar [INSERT INTO testtable VALUES (?:data)]; nested exception is
java.sql.SQLException: No value specified for parameter 1
	at
org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:98)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
	at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
	at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
	at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
	at
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
	at
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
	at
org.apache.camel.component.sql.SqlProducer.process(SqlProducer.java:48)[camel-sql-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:81)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at
org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
	at org.apach*



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-SQL-component-Insert-Operation-tp5759066.html
Sent from the Camel Development mailing list archive at Nabble.com.

Mime
View raw message