Camel
  1. Camel
  2. CAMEL-5003

Add support of generated keys retrieval in JDBC component

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.9.0
    • Fix Version/s: 2.10.0
    • Component/s: camel-jdbc
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Unknown

      Description

      The JDBC component has no support of generated keys retrieval, i.e use of Jdbc api calls :

      • statement.execute(String, int)
      • [statement.execute(String, int[])|http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#execute(java.lang.String,%20int[])]
      • [statement.execute(String, String[])|http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#execute(java.lang.String,%20java.lang.String[])]

      This patch allow to retrieve the generated keys using headers :

      • JDBC_RETRIEVE_GENERATED_KEYS : boolean (mandatory to retrieve the generated keys)
      • JDBC_GENERATED_COLUMNS : containing the int[] or String[] generated keys expected (optional)

      The results are put in two headers :

      • JDBC_GENERATED_KEYS_DATA : the generated keys rows
      • JDBC_GENERATED_KEYS_ROW_COUNT : the number of generated keys rows put

        Activity

        Thomas Gueze created issue -
        Hide
        Thomas Gueze added a comment -

        Patch resolving the issue

        Show
        Thomas Gueze added a comment - Patch resolving the issue
        Thomas Gueze made changes -
        Field Original Value New Value
        Attachment support_of_generated_keys.patch [ 12514349 ]
        Hadrian Zbarcea made changes -
        Assignee Hadrian Zbarcea [ hadrian ]
        Hadrian Zbarcea made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Hadrian Zbarcea added a comment -

        Thanks for the contribution. Looks good at the first glance.

        Show
        Hadrian Zbarcea added a comment - Thanks for the contribution. Looks good at the first glance.
        Hadrian Zbarcea made changes -
        Fix Version/s 2.10.0 [ 12317612 ]
        Affects Version/s 2.9.0 [ 12316374 ]
        Hide
        Claus Ibsen added a comment -

        Thomas, thanks for the patch.

        I have applied it, as well updated documentation.

        Show
        Claus Ibsen added a comment - Thomas, thanks for the patch. I have applied it, as well updated documentation.
        Claus Ibsen made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Assignee Hadrian Zbarcea [ hadrian ] Claus Ibsen [ davsclaus ]
        Resolution Fixed [ 1 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        2h 42m 1 Hadrian Zbarcea 13/Feb/12 15:40
        In Progress In Progress Resolved Resolved
        40d 22h 41m 1 Claus Ibsen 25/Mar/12 15:22

          People

          • Assignee:
            Claus Ibsen
            Reporter:
            Thomas Gueze
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development