ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Bibb <richard.b...@aimhedge.com>
Subject Re: Returning Three ArrayLists
Date Thu, 20 Aug 2009 13:54:36 GMT

Hi Clinton

Your reply was exactly what I wanted. My only problem is that I'm not quite
sure how to use the ResultContext object that is returned to me (iBatis3.0)

ResultContext has a number of methods associated with it. One tells you how
many rows were returned, another gives you a resultObject and the confusing
one is the nextResultObject method. It looks to me as if I'm meant to
itterate over the result set using nextResultObject. Is that right and if so
what is the getResultObject method for?

Clinton Begin wrote:
> It's against the design of SQL and JDBC, but not iBATIS.... :-)
> Just write a custom RowHandler (or ResultHandler in iBATIS 3).
> I'll use pseudocode since I don't know which version you're using....
> //assume you just map the results to a HashMap originally
> List list1;
> List list2;
> List list3;
> handleResult(Object result) {
>   Map map = (Map) result;
>   list1.add(map.get("Number1");
>   list2.add(map.get("Number2");
>   list3.add(map.get("Number3");
> }
> Clinton

View this message in context: http://www.nabble.com/Returning-Three-ArrayLists-tp25057560p25062567.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org

View raw message