derby In memory database + junit
derby In memory database + junit
If you are using Maven for your build, you can use the derby-maven-plugin, which I wrote and is available on GitHub and via Maven Central. It will take care of starting and stopping the database for you before your tests.
You can check here for my answer to a similar question.