camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pitabwire <bwire...@gmail.com>
Subject Re: how to do a registry of type: javax.sql.DataSource
Date Sun, 24 Mar 2013 09:09:58 GMT
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.

Mime
View raw message