camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: How can I split resultset that come from database?
Date Fri, 02 Dec 2011 10:47:07 GMT
On Fri, Dec 2, 2011 at 11:36 AM, Christian Müller
<christian.mueller@gmail.com> wrote:
> Use "split(body())".
>

Yes this will work if the message body is Iterateable, such as a
Collection, Array, List etc.

However if the body is a pure javax.sql.ResultSet then that API is not
iterateable.

You could add a custom type converter from ResultSet -> Iterator
And then implement the logic there, and also implement the Closeable
interface, and close the resultset on the close() method.
The Camel splitter supports the Closeable interface.



> Best,
> Christian
>
> On Fri, Dec 2, 2011 at 11:02 AM, focaldi <ferit.ocaldi@tav.aero> wrote:
>
>> Hi, I am trying to split a resultset. My Route runs a select sql in
>> database
>> after that it will send all resultset in a message. But I need to split the
>> resultset and send to queue row by row. Ho can I do this? Thanks all
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/How-can-I-split-resultset-that-come-from-database-tp5041311p5041311.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message