mercredi 4 mars 2015

Groovy Sql in Grails project to access SqlServer classpath issue

Environment: Windows 7 Enterprise, SP1, 64-bit, IntelliJ Ultimate 14.0.3, build #IU-139.1117, Java jdk 1.8.0_3


I'm trying to migrate data from Sql Server. It is not necessary to define a datasource. This works with Groovy standalone, but not in Grails: def sql = Sql.newInstance( 'jdbc:jtds:sqlserver://OSSA:1433/LTT;domain=camp', 'dxg151430', ***', 'net.sourceforge.jtds.jdbc.Driver' ) With Groovy, I put the driver jar, jtds-1.3.1.jar on the classpath. In Grails, I added this dependency to the BuildConfig.groovy: runtime "net.sourceforge.jtds:jtds:1.3.1" I Grails I get "No suitable driver found for jdbc:jtds:sqlserver://OSSA:1433/LTT;domain=camp". I had the same error message with Groovy standalone, before I added the .jar to the classpath. I've also tried to add the .jar to the Grails lib folder. And yes, with both options, dependency declaration or lib folder, I did "Grails compile --refresh-dependencies". Tried it from CMD and within the IDE.


Aucun commentaire:

Enregistrer un commentaire