Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
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 :
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
-
GROOVY-3730
Provide more control for @Grapes to exclude transitives or adjust classloader
-