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 4B02C9C2C for ; Thu, 8 Mar 2012 07:23:22 +0000 (UTC) Received: (qmail 55851 invoked by uid 500); 8 Mar 2012 07:23:21 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 55384 invoked by uid 500); 8 Mar 2012 07:23:16 -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 55321 invoked by uid 99); 8 Mar 2012 07:23:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Mar 2012 07:23:15 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of willem.jiang@gmail.com designates 209.85.214.173 as permitted sender) Received: from [209.85.214.173] (HELO mail-tul01m020-f173.google.com) (209.85.214.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Mar 2012 07:23:09 +0000 Received: by obbup6 with SMTP id up6so356725obb.32 for ; Wed, 07 Mar 2012 23:22:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=HjyTNM/Wv7fj9eq4mdoIP4b0Mqwip+I4gIx8j6QpNHM=; b=grf7jETc1GxmSOU6amhuR+35NqA4PBaKEndXQf8iSwx0+nYZjCK7pE01qX5qGSOzzi rg3M1hugQuMq/h4i6FxnMpXgxBSYwfdk051ZvM8W5TDkc8quYbsBLq6wMzlEL7BnGnhE 2l6znPkLbLJ6sTkSFkukNB32g0KaeLFUJdO0v/q643WH5tnelhrC+vtb5aYeYcgW/K3s dcm40CBDacBKVtI1pMaJnmlEKdoX+4vJBkt694mFM+1yIZd1pb2MIBtlDRIBSHNWeEbp PCN2B360ZOU542PrjeF0N+NigOMXbC68kqFe0FjeHVK/43ddVgvSp/Q3MMqR1vse/93r IZJQ== Received: by 10.60.3.104 with SMTP id b8mr2048411oeb.13.1331191368027; Wed, 07 Mar 2012 23:22:48 -0800 (PST) Received: from [192.168.0.158] ([125.34.6.51]) by mx.google.com with ESMTPS id dy7sm1416726obb.13.2012.03.07.23.22.45 (version=SSLv3 cipher=OTHER); Wed, 07 Mar 2012 23:22:47 -0800 (PST) Message-ID: <4F585E43.5090503@gmail.com> Date: Thu, 08 Mar 2012 15:22:43 +0800 From: Willem Jiang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: users@camel.apache.org Subject: Re: Need help to load csv into database References: <1331157743172-5545754.post@n5.nabble.com> In-Reply-To: <1331157743172-5545754.post@n5.nabble.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org I think you can user the bean to do the below job yourself. You just need to read the message body an split the message, put it into sql parameter and call the jdbc yourself. On Thu Mar 8 06:02:23 2012, brbornia wrote: > Hello guys, > > I'm just starting with camel, so sorry to bother you with a must likely > dummy question. > > I am trying to load a csv file into database with something like this: > > > com.test.integration.camel.spring.poc > > > > > > uri="sql:INSERT INTO mytable (id, name, event, time) > VALUES (#, #, #, #)?dataSourceRef=myDataSource"/> > > > > > > And I know that will not work because I separated the csv line into several > messages when what I want is simple convert that line to an array or > something like that, but I just do not know how to do it. > > A friend told me how to do it converting the csv lines into beans and > inserting them with JPA, but since I will be loading huge csv files very > often, I am concerned about unnecessary memory and processing use, so I > would like to do it without creating several objects. > > Can you please help me? > > Thank you in advance, > Bruno > > -- > View this message in context: http://camel.465427.n5.nabble.com/Need-help-to-load-csv-into-database-tp5545754p5545754.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Willem ---------------------------------- FuseSource Web: http://www.fusesource.com Blog: http://willemjiang.blogspot.com (English) http://jnn.javaeye.com (Chinese) Twitter: willemjiang Weibo: willemjiang