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

compilation issue 'Description Resource Path Location Type Groovy:expecting EOF, found 'while' @ line 12, column 2. ConnectToDb2Groovy.groovy /MDS2_Dev/src/com/mds2/automation line 12 Java Problem'

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 2.4.0
    • Fix Version/s: None
    • Component/s: groovy-jdk
    • Labels:
      None

      Description

      Hello all, There is a problem with the Groovy compilation

      Here is the code

      package com.mds2.automation
      import groovy.sql.Sql
      class ConnectToDb2Groovy {
       
      def url = 'jdbc:db2://9.202.178.157:50000/MDS2_DEV'
      def user = 'db2admin'
      def password = 'Password123'
      def driver = 'com.ibm.db2.jcc.DB2Driver'
      def sqlStr = Sql.newInstance(url, user, password, driver)
       
      sqlStr.query('SELECT * FROM MDS2.BOND'){resultSet ->
      while (resultSet.next()) {
      print resultSet.getString(1)
      }
      }
      

      Here is the error found in the ecllipse

      Description Resource Path Location Type
      Groovy:expecting EOF, found 'while' @ line 12, column 2. ConnectToDb2Groovy.groovy /MDS2_Dev/src/com/mds2/automation line 12 Java Problem

       

      Description Resource Path Location Type
      Groovy:unexpected token: sqlStr @ line 11, column 2. ConnectToDb2Groovy.groovy /MDS2_Dev/src/com/mds2/automation line 11 Java Problem

       

      Description Resource Path Location Type
      Groovy:unexpected token: while @ line 12, column 2. ConnectToDb2Groovy.groovy /MDS2_Dev/src/com/mds2/automation line 12 Java Problem

       

      Here are the details :eclipse kepler with IBM Java 8 SKD & Groovy 2.4

        Attachments

          Activity

            People

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              kthulsidoss Thulsi Doss Krishnan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: