This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

missing parameters in Spring Integration with JDBC

Jun 10th, 2013, 11:01 PM

Hi,

I have an Spring Integration application that reads a LinkedHashMap payload from AMQP inbound and uses JDBC gateway to insert a new record into a table. About 30% of the time the insert fails with an JDBC error about a missing parameter. the payload of the message sometimes has null values expressed in the LinkedHashMap like groupname=null, pic=null, etc. does this cause a problem when building the sql statement with

Code:

:payload[groupname]

syntax? if so what is the solution? these columns do allow null values in the database. I will fill in this post with some code examples and stack traces as we progress.

Comment

Hi, Rich!
Yes, it would be excelent, if you provide a StackTrace.
While I look at the code.

-Artem

15:50:43.159 DEBUG [SimpleAsyncTaskExecutor-1][org.springframework.jdbc.datasource.DataSourceUtil s] Fetching JDBC Connection from DataSource
15:50:43.159 DEBUG [SimpleAsyncTaskExecutor-1][org.springframework.jdbc.core.StatementCreatorUtil s] Could not check database or driver name
java.sql.SQLException: Parameter metadata not available for the given statement

Comment

I have reproduced this a number of times no matter what the code. If the value in the LinkedHashMap is like Lparameter=null, then the SQL Statement like "select * from table where column = :Lparameter" fails with the error above.