Author Login
Post Reply
I guess a lot of people use sql.rows or sql.eachRow to avoid using ResultSet's altogether.
But improving the doco is always worthwhile. And contributions from all sources are welcome! ;-)
Cheers, Paul.
On 13/03/2010 7:44 AM, Nagelberg, Kallin wrote:
> Thanks, that was perfect. That really ought to be front and center in the groovy sql tutorials :P
>
> Cheers,
> Kallin Nagelberg
>
> -----Original Message-----
> From: Paul King [mailto:paulk@(protected)]
> Sent: Friday, March 12, 2010 4:04 PM
> To: user@(protected)
> Subject: Re: [groovy-user] transform resultset to map
>
>
> Just call toRowResult()
>
> Cheers, Paul.
>
> On 13/03/2010 6:14 AM, Nagelberg, Kallin wrote:
>> I have started doing some work using GroovySQL and am curious about any
>> conveniences people may have developed or be aware of for dealing with
>> rows/columns, ie. resultsets. When I run a toString on a row I get
>> something almost JSON like:
>>
>> [a:1, b:2, c:3, d:maybe a sentence blah blah, e:10.4]
>>
>> Etc.
>>
>> Is there an easy way to transform the resultset into a map? I think I
>> can do it using the metadata of the result set to find the columns, then
>> loop over them etc., but it seems like such a common occurrence I
>> imagine there must be a better way.
>>
>> Thanks,
>>
>> Kallin Nagelberg.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email