groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Heintze <sieg_hein...@yahoo.com>
Subject Wanted: help with using jdbc grapes in groovy shell?
Date Sun, 10 Jan 2016 06:25:41 GMT
 Why does the groovy shell require a special syntax?
I'm trying to make this work in the groovyConsole.
@GrabConfig(systemClassLoader=true)
groovy.grape.Grape.grab(group:'net.sf.ucanaccess', module:'ucanaccess', version:'3.0.1')
sql = groovy.sql.Sql.newInstance("jdbc:ucanaccess://"+ System.getenv()['USERPROFILE']+ "\\Documents\\bin\\BackupRecords.mdb","net.ucanaccess.jdbc.UcanaccessDriver");
sql.eachRow("SELECT pattern FROM FileNamePattern, (SELECT idFileNamePattern FROM FileNamePatternGroupToFileNamePattern
WHERE idFileExclusionGroup=( SELECT idFileExclusionGroup FROM Directory WHERE directory=:dir))
WHERE id = idFileNamePattern  ", [dir:"%USERPROFILE%\\Documents\\WinOOP"]){ println it }
The first line does not work well! Can someone show me out to use the class loader in the
groovy console?
Unfortunately, the blog that explained how to do this is now gone.
ThanksSiegfried
Mime
View raw message