Announcement Announcement Module
Collapse
No announcement yet.
missing parameters in Spring Integration with JDBC Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • missing parameters in Spring Integration with JDBC

    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.

    Thanks,

    Rich

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

    -Artem

    Comment


    • #3
      And show your config, please, which causes an issue.

      Comment


      • #4
        Originally posted by Cleric View Post
        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


        • #5
          Originally posted by Cleric
          And show your config, please, which causes an issue.
          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.

          Comment


          • #6
            Hi!
            1. Show, please, your dataSource and gateway config
            2. -- your payload object for jdbc gateway
            3. -- more StackTrace
            4. Haven't you tried to Google on the matter:
            java.sql.SQLException: Parameter metadata not available for the given statement
            regarding your DB and its driver?

            I believe in general it's a problem of your app, but with scant info, it's difficult to determine what's going on...

            Cheers

            Comment

            Working...
            X