For unit tests, demonstrations and Hibernate tasks I would like to use a small and simple Java database like Derby / Java DB or HSQLDB, which can be called from within Maven.
So far I have not found a Maven plugin which can download and launch Java DB (which is my favorite at the moment) or something similar.
An simple setup for unit tests is to start hsqldb in memory:
No start and stop needed. The JDBC driver will “start” the database.
You could use that for demonstrations, too. If you’re initializing the database while the applications starts.
The database setup can be done with hibernate.hbm2ddl.auto.
Edit by kdgregory:
To have Maven include HSQLDB in the dependencies for the test phase only, use this in your POM: