groovy-console

Groovy Console read input

我们两清 提交于 2019-12-02 18:15:17
I'm just starting to learn Groovy and I am experimenting in GroovyConsole. Is there a way I can read user input? I have tried the code below but I get an error. BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) print "Input:" input = br.readLine() println "You entered: $input" This is the error I am receiving: Exception thrown 17-Apr-2012 02:52:39 org.codehaus.groovy.runtime.StackTraceUtils sanitize WARNING: Sanitizing stacktrace: java.io.IOException: Stream closed Is there anything I need to import? Any help would be great. Thanks I got here trying to find out the

What is classpath for Groovy Console / jdbc driver prblem?

感情迁移 提交于 2019-11-28 02:17:22
Such database code is OK in Java environment (without binded value 'c'), but in Groovy console can't properly use jdbc, with exception java.sql.SQLException: No suitable driver found for jdbc:sqlserver://localhost;databaseName= Driver class is known for script (is loaded without null etc) but probably not registered in Drivermanager ? code (i try with and without Class.forname() ) import groovy.sql.Sql import groovy.sql.DataSet c = Class.forName('com.microsoft.sqlserver.jdbc.SQLServerDriver') def db = [url:'jdbc:sqlserver://localhost;databaseName=... ,driver:'com.microsoft.sqlserver.jdbc

What is classpath for Groovy Console / jdbc driver prblem?

一笑奈何 提交于 2019-11-26 22:10:52
问题 Such database code is OK in Java environment (without binded value 'c'), but in Groovy console can't properly use jdbc, with exception java.sql.SQLException: No suitable driver found for jdbc:sqlserver://localhost;databaseName= Driver class is known for script (is loaded without null etc) but probably not registered in Drivermanager ? code (i try with and without Class.forname() ) import groovy.sql.Sql import groovy.sql.DataSet c = Class.forName('com.microsoft.sqlserver.jdbc.SQLServerDriver')