I'm trying to do some basic queries using the groovy.sql.Sql object, and I'm getting a SQLException that I can't seem to diagnose or make go away. I've reduced it to the simplest case, and I'm still seeing the problem. My code:
import groovy.sql.Sql
def bodyText
def sql = Sql.newInstance("jdbc:oracle:thin:@192.168.X.Y:1521:hostname",
"user", "passwd", "oracle.jdbc.OracleDriver")
sql.eachRow('select * from t_email_recipients') { row ->
assert row.body != null
java.sql.Clob clob = (java.sql.Clob) row.body
bodyText = clob.getAsciiStream().getText()
println bodyText
}
I had a version of this working earlier, but now all is seem to get are something like:
Caught: java.sql.SQLException: Invalid column name
at sqlTest$_run_closure1.doCall(sqlTest.groovy:14)
at sqlTest.run(sqlTest.groovy:13)
Anyone have any ideas here? I'm using groovy 1.7.4, and jdk 1.6.0_12.