Hi John,

You should be able to wrap a separate data source around each of your databases and access them both via the same EmbeddedDriver. There is not much information in this SQLException. Can you share more of the stack trace and/or the derby log file? That will help us puzzle through this.

Thanks,
-Rick

jp4 wrote:
I am trying to mimic an standalone version of a test and production
environment using Derby.  When I run my unit test cases, I would like to
load two databases using the EmbeddedDriver.  Does the EmbeddedDriver
support mulitple databases? If so, how is this accomplished.
I am trying to startup the datasources using the Spring configuration Below

        <bean id="dataSourcePerm"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url.perm}" p:username="${jdbc.username}"
                p:password="${jdbc.password}" />
<bean id="dataSourceTemp"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url.temp}" p:username="${jdbc.username}"
                p:password="${jdbc.password}" />

With properties

jdbc.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
jdbc.url.perm=jdbc:derby:../benefitrealization-dataaccess/target/brpermdb
jdbc.url.temp=jdbc:derby:../benefitrealization-dataaccess/target/brtempdb
jdbc.username=user
jdbc.password=password

When I try running my unit tests with this configuration, I get the
following error:

is java.sql.SQLException: Failed to start database
'../benefitrealization-dataaccess/target/brpermdb',
Thanks,

jp4

Reply via email to