groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maarten Boekhold <boekh...@gmx.com>
Subject Re: GroovySQL and (manually) iterating over a ResultSet
Date Tue, 30 Aug 2016 07:08:01 GMT
Hi,

Ah darn, I was just looking at the docs for the Groovy API (groovy.Sql), 
but forgot to look at the JDK extensions (java.sql)....

So just to answer myself:

GroovyRowResult row = ResultSet.toRowResult()

Maarten

On 2016-08-30 11:00, Maarten Boekhold wrote:
> Hi all,
>
> I'm aware of Sql.eachRow() etc, but I need more control while 
> iterating over each row of a ResultSet. To run my query, I can use 
> Sql.executeQuery(), which returns a ResultSet, and I can of course run 
> ".next()" on that. But I'll lose all the nice groovy-features of 
> getting to the row results.
>
> Is there any way to get a GroovyRowResult for the current row of a 
> ResultSet that was returned by Sql.executeQuery()?
>
> Maarten


Mime
View raw message