You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2013/04/03 11:12:35 UTC

Re: how to do a registry of type: javax.sql.DataSource

Yes you can use the bind method on the Main class to bind a bean to
the registry.



On Sun, Mar 24, 2013 at 10:09 AM, pitabwire <bw...@gmail.com> wrote:
> Hi Mr claus you could just bind the datasource to the default camel runner if
> you are not using any containers to run your route as shown below.
>
>
>
> package com.notifications;
>
> import org.apache.camel.main.Main;
>
> /**
>  * A drops notifications .
>  */
> public class StartupManager {
>
>     /**
>      * A main() so we can easily run these routing rules in our IDE
>      */
>     public static void main(String... args) throws Exception {
>         Main main = new Main();
>        main.enableHangupSupport();
>
>
>
>       DriverManagerDataSource ds = new DriverManagerDataSource();
>
>               ds.setDriverClassName("com.mysql.jdbc.Driver");
>             ds.setUrl("jdbc:mysql://localhost:3306/examen");
>             ds.setUsername("root");
>             ds.setPassword("");
>
>        main.bind("datasource", ds);
>
>
>         //Configure routes for operations.
>        ....
>
>              //Then start the routes...
>              main.run(args);
>
>
>
>     }
> }
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/how-to-do-a-registry-of-type-javax-sql-DataSource-tp5729644p5729730.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen