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

Grape issues

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.3
    • 1.7-beta-2
    • Grape
    • None
    • jdk 1.5-06
      groovy 1.6.3
      WIndows xp

    Description

      I have a simple piece of groovy for accessing a (oracle) DB.

      The code works fine once I include the jdbc jar in my $GROOVY_HOME/lib folder.

      However I would like to use grape to dynamically manage dependencies so I changed the code to below.

      import groovy.grape.Grape
      
      Grape.grab(group:'oracle', module:'ojdbc14', version:'10.1.0.4.0' )
      import groovy.sql.Sql
      import java.sql.Time
      
      def db = Sql.newInstance("jdbc:oracle:thin:@flagtest.intmet.ie:1525:BEAM", "user", "password", 
      		"oracle.jdbc.driver.OracleDriver")
      

      This results in

      Caught: java.sql.SQLException: No suitable driver
              at t2.run(t2.groovy:8)
      

      If I add the following import after the Grape.grab

      import oracle.jdbc.driver.OracleDriver
      

      I get the following

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed,
      C:\dev\t2.groovy: 4: unable to resolve class oracle.jdbc.driver.OracleDriver
       @ line 4, column 1.
         import oracle.jdbc.driver.OracleDriver;
         ^
      

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              khylo Keith Hyland
              Votes:
              5 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: