Hi Mr claus is still get this message im so pressed i have to do it for my
project of end of year  public static void main(String[] args) throws
Exception {             // TODO Auto-generated method stub              
//DataSource dd;                
DriverManagerDataSource ds = new DriverManagerDataSource();                     
     
ds.setDriverClassName("com.mysql.jdbc.Driver");    
ds.setUrl("jdbc:mysql://localhost:3306/examen");            
ds.setUsername("root");        
ds.setPassword("");            //JndiRegistry reg = null;               
SimpleRegistry
reg = new SimpleRegistry() ;            reg.put("datasource",ds); //           
reg.bind("datasource","timlogdb");        CamelContext context = new
DefaultCamelContext(reg);context.addRoutes(new
MyRouteBuilder());context.start();Thread.sleep(10000);context.stop();
}}/**********Route builder*////////public class MyRouteBuilder extends
RouteBuilder {    /**     * Let's configure the Camel routing rules using
Java code...     */     javax.sql.DataSource ds;    public void configure() {   
              
// reg.put("datasource",ds);         // here is a sample which processes the
input files        // (leaving them in place - see the 'noop' flag)*/       
// then performs content based routing on the message using XPath     
from("file:src/data?noop=true")            .choice()               
.when(xpath("/person/user ='SFIN'"))                   
.setBody(constant("INSERT INTO user
values('A','b','vvv');")).to("jdbc:mysql://localhost:3306/examen")       
.otherwise()        .to("file:target/messages/others");                       
}Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: jdbc://jdbc:mysql://localhost:3306/examen due to: No bean
could be found in the registry for: jdbc:mysql://localhost:3306/examen of
type: javax.sql.DataSource}



--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-do-a-registry-of-type-javax-sql-DataSource-tp5729644p5729720.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to