nagl wrote:
Hi,
I am using spring framework to create datasource using xapool and jotm.
I want a configurable datasource for oracle and derby.
The following are the bean definitions I am using:
[code]<bean id="innerorgDataSource"
class="org.enhydra.jdbc.standard.StandardXADataSource"
destroy-method="shutdown">
<property name="transactionManager">
<ref local="jotm" />
</property>
<property name="driverName">
<value>${jdbc.ClassName}</value>
</property>
<property name="url">
<value>
${jdbc.org.URL}
</value>
</property>
</bean>
<bean id="orgDataSource"
class="org.enhydra.jdbc.pool.StandardXAPoolDataSource"
destroy-method="shutdown">
<property name="dataSource">
<ref local="innerorgDataSource" />
</property>
<property name="user">
<value>${jdbc.org.user}</value>
</property>
<property name="password">
<value>${jdbc.org.password}</value>
</property>
<property name="maxSize">
<value>30</value>
</property>
</bean>[/code]
Following are the properties I am using for derby datasource:
[code] org.apache.derby.jdbc.EmbeddedDriver
jdbc:derby:target/derby/orgDB;create=true
org
org[/code]
Now when i am passing oracle properties for the placeholders the datasource
is successfully created.
But when i switch to derby i get the following error.
java.sql.SQLException: Cannot get connection for URL
jdbc:derby:target/derby/luDB;create=true
: No suitable driver found for
jdbc:derby:target/derby/luDB;create=true
Now I am using Maven for dependencies and have made sure that derby is
included in the dependency and its also clearly visible in the dependency
graph in eclipse.
What else can be the issue. Please put in your suggestions.
I am not familiar with the implementation of
org.enhydra.jdbc.standard.StandardXADataSource and I don't know that
this is directly related to the error you are getting, but for Derby XA
connections, you need to use the EmbeddedXADataSource. You can't start
xa transactions after connecting with DriverManager.getConnection() or
EmbeddedDriver.connect() and specifying an url. I don't understand
how these parameters could get you to the EmbeddedXADataSource that you
need, unless StandardXADataSource knows something specific about Derby.
Kathey