In BasicDataSource you can configure whether you will get the underlying connection or a proxy ( accessToUnderlyingConnectionAllowed) . Getting the proxy is the default configuration. May this solves your issue.
Best, Christian Sent from a mobile device Am 19.03.2013 15:25 schrieb "jinaLu" <[email protected]>: > I tried like this. In fuseEsb etc xml file I have config: > > <bean id="oracle-AQ" class="org.apache.commons.dbcp.BasicDataSource" > destroy-method="close"> > <property name="driverClassName" value="oracle.jdbc.OracleDriver"/> > <property name="url" > value="jdbc:oracle:thin:@ > (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.10.10)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=mydb)))"/> > <property name="username" value="db"/> > <property name="password" value="password"/> > <property name="validationQuery" value="SELECT 1 FROM DUAL"/> > </bean> > <bean id="jdbc-oracle-AQ" > class="lt.etic.smx.tools.cfgmgr.impl.jdbc.JdbcConnectionProbe"> > <constructor-arg index="0" value="31000"/> > <property name="dataSource" ref="oracle-AQ"/> > <property name="probeQuery" value="SELECT 2 FROM DUAL"/> > </bean> > > In my blueprint xml I have: > <blueprint:reference id="DBC" interface="javax.sql.DataSource" > filter="(name=oracle-AQ)"/> > <blueprint:bean id="connectionFactoryOracleAQQueue" > class="oracle.jms.AQjmsFactory" > factory-method="getQueueConnectionFactory"> > <blueprint:argument ref="DBC" /> > </blueprint:bean> > > <blueprint:bean id="oracleQueue" > class="org.apache.camel.component.jms.JmsComponent"> > <blueprint:property name="connectionFactory" > ref="connectionFactoryOracleAQQueue" /> > </blueprint:bean> > My ruoteBuilder has: > from("direct:test") > .to("oracleQueue:queue:AQ_Q") > > But unfortunately I'm getting "Caused by: java.lang.ClassCastException: > org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot > be cast to oracle.jdbc.internal.OracleConnection". > > Any ideas? > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/oracle-jms-AQjmsFactory-and-javax-sql-DataSource-tp5729223p5729423.html > Sent from the Camel - Users mailing list archive at Nabble.com. >
