camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Moulliard <ch0...@gmail.com>
Subject Re: Configuring database with jdbc
Date Wed, 09 Jul 2014 10:05:22 GMT
Hi Licia,

Here is a project (part of the FuseByExample github repo) where there is an
example about how to setup the camel jdbc component using spring to
instantiate a DataSource.

https://github.com/FuseByExample/camel-persistence-part1/blob/master/jdbc/src/main/resources/META-INF/spring/camelContext.xml#L71

Regards,

Charles


On Wed, Jul 9, 2014 at 11:56 AM, Licia <alicia.parisse@gmail.com> wrote:

> 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.
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message