Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3136

Groovy SQL eachRow and Resultset in parameters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.7
    • 1.6.5
    • SQL processing
    • None
    • Windows XP SP3

    Description

      Using eachRow and passing parameters containing resultsets will fail.
      The eachRow method will instantiate a PreparedStatement and use setParameters and then setObject,
      which will result in a ClassCastException (catched in line 1416), because it tries to cast to a CallableStatement.
      But there is no eachRow-Method with a CallableStatement...

      Workaround:
      use Sql.call and make sure your resultsets get closed explicitly, after executing your statement (you just got a feature request )

      A possible solution would be to detect OutParameters and then use a CallableStatement.
      If ResultSetOutParameters are used, a modified Sql.call function that cleans up resultsets as well could be used.
      You could also close the ResultSets in the eachRow method after calling the "current" call-Method.... adeveloper would still have to clean up ResultSets using the call-method though.

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              ukistler Ueli Kistler
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: