Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-10870

camel-sql stored procedures don't support negative vendor-specific JDBC types

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.18.3, 2.19.0
    • Component/s: camel-sql
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Unknown

      Description

      When you use a vendor-specific JDBC type in camel-sql you need to use its value instead of its label.

      For instance, if you use oracle if you want to call a stored procedure that returns a FIXED_CHAR type you need to write:

      <to uri="sql-stored:PROCEDURE1(OUT 999 result)?dataSource=oracle"/>
      

      All values are defined here: https://docs.oracle.com/cd/E16338_01/appdev.112/e13995/constant-values.html#oracle_jdbc_OracleTypes_ARRAY

      You can notice that there are negative values in this list (CURSOR for instance). Unfortunately the negative values aren't handled by the parser which leads to the following exception

      org.apache.camel.component.sql.stored.template.ast.ParseRuntimeException: Field -10 not found from java.procedureName.Types
      	at org.apache.camel.component.sql.stored.template.ast.ParseHelper.parseSqlType(ParseHelper.java:41)
      	at org.apache.camel.component.sql.stored.template.generated.SSPTParser.OutParameter(SSPTParser.java:92)
      	at org.apache.camel.component.sql.stored.template.generated.SSPTParser.Parameter(SSPTParser.java:60)
      	at org.apache.camel.component.sql.stored.template.generated.SSPTParser.parse(SSPTParser.java:23)
      	at org.apache.camel.component.sql.stored.template.TemplateParser.parseTemplate(TemplateParser.java:31)
      	at org.apache.camel.component.sql.stored.CallableStatementWrapperFactory.getTemplateStoredProcedure(CallableStatementWrapperFactory.java:71)
      	at org.apache.camel.component.sql.stored.CallableStatementWrapper.populateStatement(CallableStatementWrapper.java:104)
      	at org.apache.camel.component.sql.stored.SqlStoredProducer$1.execute(SqlStoredProducer.java:69)
      	at org.apache.camel.component.sql.stored.CallableStatementWrapper.call(CallableStatementWrapper.java:55)
      	at org.apache.camel.component.sql.stored.SqlStoredProducer.process(SqlStoredProducer.java:43)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                davsclaus Claus Ibsen
                Reporter:
                antoine.dessaigne Antoine DESSAIGNE
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: