This will help you: http://stackoverflow.com/questions/9183321/how-to-use-jndi-datasource-provided-by-tomcat-in-spring.
Raúl. > On 12 Apr 2014, at 06:43, moj0002 <[email protected]> wrote: > > I have my data source defined in a jboss ds file (myDB2Database-ds.xml) that > goes either in the jboss deploy directory or ds directory > > <?xml version="1.0" encoding="UTF-8"?> > <datasources> > <local-tx-datasource> > <jndi-name>myDataSource</jndi-name> > <connection-url>jdbc:db2://....;</connection-url> > <driver-class>com.ibm.db2.jcc.DB2Driver</driver-class> > ... more properties here > </local-tx-datasource> > </datasources> > > In my spring application context I define my route > > > <import resource="classpath:sql-beans.xml"/> > > <camelContext xmlns="http://camel.apache.org/schema/spring"> > <route> > <from uri="timer://foo?fixedRate=true&period=1m"/> > <to uri="bean://sqlBean"/> > <to uri="jdbc://java:myDatasource"/> > > > My sqlBean is just a simple > > public class SqlBean > { > public String toSql() > { > return "select current timestamp from sysibm.sysdummy1"; > } > } > > I can't figure out how to reference the jndi data source (myDataSource) > defined in the ds.xml file > <to uri="jdbc://java:myDatasource"/> > is not working. > > How do I get the data source registered so I can get a handle to it? > > Looks like osgi uses <reference> but I am not running in an OSGI container, > just plain JBOSS 5.2 J2EE. > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/JDBC-component-and-jboss-ds-xml-file-tp5750137.html > Sent from the Camel - Users mailing list archive at Nabble.com.
