I have the following code in groovy, and I need to control to loop the rows, so that I can split the rows in chucks in pass them to other threads (by actor). but looks like next() can’t be called, I didn’t the following test
def ORACLE = Sql.newInstance( "jdbc:oracle:thin:@.....", "xxx", "xxx", "oracle.jdbc.driver.OracleDriver" )
java.sql.ResultSet rs = ORACLE.executeQuery("select 1 as x from dual")
rs.next()
error:
Oct 30, 2012 6:15:44 AM org.codehaus.groovy.runtime.StackTraceUtils sanitize
WARNING: Sanitizing stacktrace:
java.sql.SQLException: Closed Statement: next
oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:242)
the following will works: just use java stype jdbc.