Thanks! I had thought of that but again I wasn't exactly sure what iBatis was
doing there and was hoping that maybe there was more simple way of doing it
then having to set all the data into my object. I guess I'm spoiled by
iBatis. It did so much for me that I didn't have to worry about all that. I
wish they would've bought into this, would've made my life much easier.
Jeff Butler-2 wrote:
>
> This is very basic JDBC - I suggest you do a google search for "JDBC
> Examples" or "JDBC Tutorial".
>
> This, in effect, is what iBATIS is doing:
>
> List answer = new ArrayList();
> while (rs.next()) {
> SomeObject so = new SomeObject();
> so.setName(rs.getString("name"));
> so.setId(rs.getInt("id"));
> answer.add(so);
> }
>
> rs.close();
>
> return answer;
>
> There's only one result set in this example - but the result set contains
> multiple records.
>
> Jeff Butler
>
>
> On 4/11/07, macdoug1 <[EMAIL PROTECTED]> wrote:
>>
>>
>> To make a long story short the place that I have been doing work for
>> didn't
>> like the iBatis mapping for some unknown reason but regardless of that
>> I'm
>> trying to figure out now how to handle one situation when performing my
>> query. When using iBatis I did a queryForList("somestatement", objval);
>> and
>> queryForList worked perfectly for me as it returned a list of known
>> object
>> types. Anyway I'm now using a PreparedStatement and using executeQuery,
>> which returns a ResultSet which I can get multiple result sets. My
>> question
>> is I can't seem to figure out a way to put the multiple result sets into
>> a
>> list which I can pass back to my business method that is expecting a
>> list.
>>
>> rs = ps.executeQuery();
>>
>> while(rs.next()){
>>
>> ???
>>
>> }
>>
>> Anyway has anyone ever done something similar to this? Is there something
>> better I can use that is closer to the queryForList ? I'm really
>> desparate
>> for a good solutioin here if anyone knows.
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Was-using-iBatis-but-have-been-forced-to-rip-it-out-of-my-code.-tf3559715.html#a9940771
>> Sent from the iBATIS - Dev mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/Was-using-iBatis-but-have-been-forced-to-rip-it-out-of-my-code.-tf3559715.html#a9941340
Sent from the iBATIS - Dev mailing list archive at Nabble.com.