jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
groovy
  • groovy
  • GROOVY-3583

Grape issues

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.6.3
  • Fix Version/s: 1.7-beta-2
  • Component/s: Grape
  • Labels:
    None
  • Environment:
    jdk 1.5-06
    groovy 1.6.3
    WIndows xp
  • Number of attachments :
    0

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;
   ^

Issue Links

is related to

Improvement - An improvement or enhancement to an existing feature or task. GROOVY-3730 Provide more control for @Grapes to exclude transitives or adjust classloader

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
No work has yet been logged on this issue.

People

  • Assignee:
    Paul King
    Reporter:
    Keith Hyland
Vote (5)
Watch (8)

Dates

  • Created:
    16/Jun/09 11:40 AM
    Updated:
    15/Jun/11 8:32 AM
    Resolved:
    14/Sep/09 9:24 AM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.