groovy
  1. groovy
  2. GROOVY-2856

groovy.sql.DataSet should alias table name in SQL to accomodate http://download.oracle.com/docs/cd/B14117_01/java.101/b10979/resltset.htm#sthref1543 17.2.2.1.1 Workaround

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: SQL processing
    • Labels:
      None
    • Environment:
      any Oracle environment
    • Number of attachments :
      0

      Description

      The example at http://groovy.codehaus.org/Database+features ...

      // allow resultSets to be able to be changed
      sql.resultSetConcurrency = java.sql.ResultSet.CONCUR_UPDATABLE

      // change the data
      sql.eachRow("select * from PERSON") {
      it.firstname = it.firstname * 2
      }

      will not work with Oracle because Oracle disallows ResultSet CONCUR_UPDATABLE on "select * from t". However, Oracle allows it for "select t1.* from t t1" per the link in this ticket's summary. Looked to me like groovy.sql.DataSet.java would do this with a little tweaking, and should be harmless to other database environments.

        Activity

        Hide
        MichaelWang added a comment -

        I also follow that's example. However, it show a error message:
        ERROR:groovy.lang.MissingPropertyException: No such property: resultSetConcurrency for class: groovy.sql.Sql

        the key code is:
        //allow resultSets to be able to be changed
        sql.resultSetConcurrency = java.sql.ResultSet.CONCUR_UPDATABLE

        I don't know why will show this message.

        Does anyone who can give me some information

        Show
        MichaelWang added a comment - I also follow that's example. However, it show a error message: ERROR:groovy.lang.MissingPropertyException: No such property: resultSetConcurrency for class: groovy.sql.Sql the key code is: //allow resultSets to be able to be changed sql.resultSetConcurrency = java.sql.ResultSet.CONCUR_UPDATABLE I don't know why will show this message. Does anyone who can give me some information
        Hide
        Paul King added a comment -

        Michael, what version of Groovy are you using?

        Show
        Paul King added a comment - Michael, what version of Groovy are you using?
        Hide
        MichaelWang added a comment -

        I use groovy in soap ui 2.0.2.

        Show
        MichaelWang added a comment - I use groovy in soap ui 2.0.2.
        Hide
        MichaelWang added a comment -

        the jar name is groovy-all-1.5.1.jar

        Show
        MichaelWang added a comment - the jar name is groovy-all-1.5.1.jar
        Hide
        Paul King added a comment -

        @Michael,

        Just checking through the src history, it looks like the CONCUR related functionality was added in 1.5.2.

        I have now added a @since tag to the Sql source file to indicate this and it will appear in the javadoc/groovydoc when we next release. Thanks for spotting this.

        It should be safe to upgrade the jar within soupui to 1.5.2 or later or maybe upgrade soupui - soapui 2.5.1 appears to include groovy 1.5.7.

        Show
        Paul King added a comment - @Michael, Just checking through the src history, it looks like the CONCUR related functionality was added in 1.5.2. I have now added a @since tag to the Sql source file to indicate this and it will appear in the javadoc/groovydoc when we next release. Thanks for spotting this. It should be safe to upgrade the jar within soupui to 1.5.2 or later or maybe upgrade soupui - soapui 2.5.1 appears to include groovy 1.5.7.
        Hide
        MichaelWang added a comment -

        Thanks Paul King.
        I will try to use soapui2.5.1

        Show
        MichaelWang added a comment - Thanks Paul King. I will try to use soapui2.5.1
        Hide
        blackdrag blackdrag added a comment -

        if this is still an issue please reopen

        Show
        blackdrag blackdrag added a comment - if this is still an issue please reopen

          People

          • Assignee:
            Paul King
            Reporter:
            Matthew Osborn
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: