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.
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.