ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From costab <k...@nym.hush.com>
Subject Re: Custom ResultSet handler
Date Tue, 02 Feb 2010 03:06:30 GMT

Wouldn't be better if the iBatis select tag would allow you to specify the
ResultSetHandler class as an attribute? 

I used Spring JDBC and this is how I did it, I used their ResultSetHandler
class to process the ResultSet the way I wanted. Then you can have one query
but then you can create different types of output, xml or pojos or excel by
simply providing which ResultSetHandler you want to process your query.


Clinton Begin wrote:
> 
> But if you really want to do this, extend the Configuration class, and
> then
> override the following method:
> 
>   public ResultSetHandler newResultSetHandler(Executor executor,
> MappedStatement mappedStatement, RowBounds rowBounds, ParameterHandler
> parameterHandler, ResultHandler resultHandler, BoundSql boundSql);
> 
> You'll have to use the pure Java configuration approach, not the XML
> configuration.
> 

Is there any sample I can look at to see how you do this?


Did you guys ever think of making use of Spring Jdbc? I think iBatis could
borrow some of the Spring Jdbc goodies and build on that foundation. There
are a lot of goodies on both sides and it would be great for users to
"springify" iBatis. That would solve the dilemma that myself and others
experience - which one I should use iBatis or Spring Jdbc?


Thanks a lot!

-- 
View this message in context: http://old.nabble.com/Custom-ResultSet-handler-tp27412455p27414917.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


Mime
View raw message