camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From moj0002 <mortenjensenh...@hotmail.com>
Subject JDBC component and jboss ds.xml file
Date Sat, 12 Apr 2014 04:37:53 GMT
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&amp;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.

Mime
View raw message