In my project I am using a derby in-memory database with the embedded
driver for unit testing and integration testing. I am using PostgreSQL
as the production server.
I am using Liquibase to set up the schema for both Derby and
PostgreSQL, and I'm also using Liquibase to set up the test data in the
What I wanted to do, was to dump the test database to a Derby network
server and do some tests on the data. My changes worked fine in
PostgreSQL but not in the derby tests, and I wanted the chance to take a
look at them.
So what I did was add a pseudo unit test to a test class, that would
connect to "jdbc:derby://localhost:1527/ukelonn".
When I tried running that test, it was unable to find the driver.
So I googled a bit more, and added a dependency to the derby client
jar in the test scope.
But then the unit test failed with the following error:
java.lang.ClassCastException: org.apache.derby.jdbc.ClientDriver cannot be
cast to org.apache.derby.jdbc.InternalDriver
Are the problems caused by me having both the embedded driver and the
network driver loaded into the same java application (in this case: the
same JUnit test)?
If there is a conflict between the embedded JDBC driver and the client
JDBC driver, is there a way around the conflict, other than creating a
separate maven project just to upload the liquibase files?