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 7F5EE11955 for ; Wed, 9 Jul 2014 10:09:28 +0000 (UTC) Received: (qmail 32838 invoked by uid 500); 9 Jul 2014 10:09:27 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 32784 invoked by uid 500); 9 Jul 2014 10:09:27 -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 32769 invoked by uid 99); 9 Jul 2014 10:09:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2014 10:09:26 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zayen.f@gmail.com designates 209.85.219.50 as permitted sender) Received: from [209.85.219.50] (HELO mail-oa0-f50.google.com) (209.85.219.50) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2014 10:09:22 +0000 Received: by mail-oa0-f50.google.com with SMTP id g18so781076oah.23 for ; Wed, 09 Jul 2014 03:09:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=CeKKUy4IhIf/Qm/n28x+A9wQIB3vwOTaqSoEZ72PLAw=; b=FQxL80cYLvI/danCC9oub1O7KF2r3GyG7WXID3JzakXF05VpYwRTkxD+uDzvUppSED L3MjWDCUavuiQ7hPARPSOSqN/CI4vSgwLxchai0cXifyCD4RAwkG0M51iCg1V9bldoNE Y9biQgTZgSNL0wfM8Zwz9I3/d/+t4QuWxPoMINDlGRcMrwq3hqhaoWyAQCyXysDr85Bx 4AT8UQxS/IhEtanImq6Wsc1eMDuF7r6nXB7BZnx+KFcDcKmcN61A6aeESL9tXNliW6b9 ZXewXC7xvryPJzk/KgtVmdxhbBP+F81dIv7C2XF6LBJJV75VzD5yiUM78Iu2RehKeM/5 xNVA== X-Received: by 10.182.91.4 with SMTP id ca4mr45629061obb.26.1404900541536; Wed, 09 Jul 2014 03:09:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.89.233 with HTTP; Wed, 9 Jul 2014 03:08:41 -0700 (PDT) In-Reply-To: <1404899777117-5753574.post@n5.nabble.com> References: <1404899777117-5753574.post@n5.nabble.com> From: fradj zayen Date: Wed, 9 Jul 2014 11:08:41 +0100 Message-ID: Subject: Re: Configuring database with jdbc To: users@camel.apache.org Content-Type: multipart/alternative; boundary=e89a8fb1f33cb96b7a04fdbfe5a5 X-Virus-Checked: Checked by ClamAV on apache.org --e89a8fb1f33cb96b7a04fdbfe5a5 Content-Type: text/plain; charset=UTF-8 Hi Licia, you can use commons dbcp for exampple to configurethe datasource. in your spring configuration file you can add a bean as below here is an example using MySQL the jdbc endpoint shoud refer to the bean id using datasource parameter hope it helps 2014-07-09 10:56 GMT+01:00 Licia : > Hi everyone, > > I'm currently still new at camel and I'm encoutering a problem. > > In fact, I have to use jdbc to make some Select/Insert SQL requests on my > database. > Until here, everything good. > > But when I use the configure method, I have a "Failed to resolve endpoint" > error. > > Here is the configure method code : > from ("file:src/data/xmlTest") > .split(xpath("/tabnames/tabname/subTrajectory/month")) > .filter().xpath("/month[@name=\"janvier\"]") > .setHeader("lic", xpath("/month/@nbWorkedDays")) > .setHeader("min", > xpath("/month/amount[@type=\"ca\"]/month/text()")) > .setBody(simple("select * from projects where license = > ${header.lic} and id > ${header.min} order by id")) > *.to("jdbc:dataSource?useHeadersAsParameters=true");* > > You'll see I'm already using xpath and things because I take inputs from an > xml file. Everything works just fine as I expect before jdbc (I tried it > using log at first). Anyway, the line that is really problematic for me is > the bold one. > > I really don't know how to configure the database, saying how to connect to > it (IP address etc.). I saw many exemples with camel-context.xml files but > I > don't know how to right it, cause every example I encountered was using a > SQL script, first creating a database/table. But I don't want to do that > since I already got one. > > If you know exemples or can explain, where/how to configure the database > connection, I'd be very thankfull. > > > P.S. : I already read the jdbc and sql examples from camel and it didn't > really help me. > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Configuring-database-with-jdbc-tp5753574.html > Sent from the Camel - Users mailing list archive at Nabble.com. > --e89a8fb1f33cb96b7a04fdbfe5a5--