"db" is the name (Spring bean or registry id) of the data source you have
to provide.
[1] shows you an example.
[2] shows how to assign the bean to the registry.

[1]
https://svn.apache.org/repos/asf/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/AbstractJdbcTestSupport.java
[2]
http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html

Best,
Christian

On Mon, Oct 1, 2012 at 10:42 PM, suralk <[email protected]> wrote:

> Hi All,
> I am trying to use a SQL Server database in a camel route using jdbc
> endpoint as follows:
> from("timer://foo?period=60000").setBody(constant("select * from
>
> customer")).to("jdbc:microsoft:sqlserver://SOBSQL01;DatabaseName=MyDatabase")
>                    .to("file://data/inbox?fileName=t.txt");
>
> However, I get an exception saying that
> Failed to resolve endpoint:
> jdbc://microsoft:sqlserver://SOBSQL01;DatabaseName=SecondLife due to: No
> bean could be found in the registry for:
> microsoft:sqlserver://SOBSQL01;DatabaseName=MyDatabase
> of type: javax.sql.DataSource
>
> How can I register my database WITHOUT using spring?
>
> jdbc component documentation says that I should do the following:
>
> JndiRegistry reg = super.createRegistry();
> reg.bind("testdb", db);
> return reg;
>
> However, I am not using camel test class. And what should be assigned to
> the
> variable db?
> Even a pointer to a documentation is much appreciated.
>
> /Sura
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/how-to-use-a-jdbc-endpoint-tp5720330.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--

Reply via email to