Difference between sql.rows().each and sql.eachRow

阅读更多

1、sql.rows returns a List of g.sql.GroovyRowResult which implements Map

def results = []
sql.rows(queryString, args).each {Map row ->
            println "row.dump():${row.dump()}"
            results << row
        }

 2、sql. eachRow iterates providing a g.sql.GroovyResultSet which implements
java.sql.ResultSet.  ResultSet is not a Map (or a Set for that matter)

 

from http://www.nabble.com/Difference-between-sql.rows().each-and-sql.eachRow()-td16914456.html

 

你可能感兴趣的:(SQL,HTML)