Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 31BAE93C1 for ; Fri, 2 Dec 2011 10:47:55 +0000 (UTC) Received: (qmail 13242 invoked by uid 500); 2 Dec 2011 10:47:54 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 13214 invoked by uid 500); 2 Dec 2011 10:47:54 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 13206 invoked by uid 99); 2 Dec 2011 10:47:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Dec 2011 10:47:54 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of claus.ibsen@gmail.com designates 209.85.215.173 as permitted sender) Received: from [209.85.215.173] (HELO mail-ey0-f173.google.com) (209.85.215.173) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Dec 2011 10:47:50 +0000 Received: by eaai10 with SMTP id i10so3447091eaa.32 for ; Fri, 02 Dec 2011 02:47:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=xNEmcYPAB6ALbvQG+5JhSdLQOIPFbq4NO4dfY/If/R8=; b=IAp1vyhvQqncBMQEwcd4oRHOICnMX4yIBCvyc5wLA52K4nMVNWOeQOb7OlYYolEsh1 48VA6GB8LreLP3zHgMvW/edTveixKBhL//PfHBIwFVfQOeAZIhc3b2K0w5XjyTyCT44Z ds1LUBZmtAEszVHxzlqu8B5OSuSPAZFJ+S62g= Received: by 10.213.19.130 with SMTP id a2mr904678ebb.126.1322822849295; Fri, 02 Dec 2011 02:47:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.99.5 with HTTP; Fri, 2 Dec 2011 02:47:07 -0800 (PST) In-Reply-To: References: <1322820174510-5041311.post@n5.nabble.com> From: Claus Ibsen Date: Fri, 2 Dec 2011 11:47:07 +0100 Message-ID: Subject: Re: How can I split resultset that come from database? To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Dec 2, 2011 at 11:36 AM, Christian M=FCller 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 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-fr= om-database-tp5041311p5041311.html >> Sent from the Camel - Users mailing list archive at Nabble.com. >> --=20 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/