jastrachan | 26 Mar 19:56 2004
Picon

Re: [groovy-dev] Re: GroovyResultSet modifications

On 26 Mar 2004, at 14:46, Ivan Z. Ganza wrote:
> Here is a patch that makes GroovyResultSet implement 
> java.sql.ResultSet interface.
>
> I pasted in from the actual Java Source code for ResultSet so the
> documentation for all methods is present.

I'm not sure legally we can do that :(

> Testcases seem to be fine and I've used this in my own code and its 
> worked.
>
> PS: I had to remove the original previous() and next() methods as they
> conflicted with those already present on ResultSet interface.

I've put them back in - they have the same prototypes - basically they 
just ensure that if you write to the result set (via the 
setProperty("name", value)) that it will call updateRow().

e.g. if you did

sql.eachRow("select * from foo") { it.amount = it.amount + 1 }

it would perform an update.

Note I haven't actually unit tested this behaviour as Axion doesn't 
support it :)

> Please let me know if you find any problems.

Thanks Ivan. Patch applied.

James
-------
http://radio.weblogs.com/0112098/

Gmane