An simple setup for unit tests is to start hsqldb in memory:
db.connection.driver_class=org.hsqldb.jdbcDriver
db.connection.url=jdbc:hsqldb:mem:aname
db.connection.username=sa
db.connection.password=
hibernate.dialect=org.hibernate.dialect.HSQLDialect
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:
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.7</version>
<scope>test</scope>
</dependency>