groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Imholz, John J." <>
Subject Database Drivers
Date Wed, 05 Apr 2017 18:28:44 GMT
In Groovy Console "Class" seems to find the Driver, but "Sql" does not?  What am I misunderstanding?
 (BTW, the connection string is what I'm using in the sqlline utility)

--- console ---
import java.sql.*
import groovy.sql.Sql

def d =  Class.forName('net.sourceforge.jtds.jdbc.Driver').newInstance()
println d.toString()

def sql = Sql.newInstance('jdbc:jtds:sybase://;tds=5.0',

--- output ---
jTDS 1.2.5
Exception thrown

java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver
                at java.lang.ClassLoader.loadClass(
                at sun.misc.Launcher$AppClassLoader.loadClass(
                at java.lang.ClassLoader.loadClass(
                at java.lang.Class.forName0(Native Method)
                at java.lang.Class.forName(
                at groovy.sql.Sql.loadDriver(
                at groovy.sql.Sql.newInstance(
                at groovy.sql.Sql$ Source)
                at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(

This message was secured via TLS by MUSC.

View raw message