I use PostgreSQL as my production database, and I use derby during development and testing.
I use liquibase to configure and populate the databases:
1. I have a library jar that sets up a database schema using liquibase
https://github.com/steinarb/ukelonn/blob/master/ukelonn.db.liquibase/src/main/java/no/priv/bang/ukelonn/db/liquibase/UkelonnLiquibase.java#L25
https://github.com/steinarb/ukelonn/blob/master/ukelonn.db.liquibase/src/main/resources/db-changelog/db-changelog-1.0.0.xml#L20
2. I have a derby plugin that sets up the schema and uses liquibase to
populate the test database
https://github.com/steinarb/ukelonn/blob/master/ukelonn.db.derbytest/src/main/java/no/priv/bang/ukelonn/db/derbytest/UkelonnDatabaseProvider.java#L44
https://github.com/steinarb/ukelonn/blob/master/ukelonn.db.derbytest/src/main/resources/sql/data/example_users.sql
https://github.com/steinarb/ukelonn/blob/master/ukelonn.db.derbytest/src/main/resources/sql/data/example_accounts.sql
https://github.com/steinarb/ukelonn/blob/master/ukelonn.db.derbytest/src/main/resources/sql/data/example_administrators.sql
https://github.com/steinarb/ukelonn/blob/master/ukelonn.db.derbytest/src/main/resources/sql/data/example_transaction_types.sql
https://github.com/steinarb/ukelonn/blob/master/ukelonn.db.derbytest/src/main/resources/sql/data/example_transactions.sql
3. I have a postgresql pugin that sets up the schema and uses
liquibase to set up some initial data
https://github.com/steinarb/ukelonn/blob/master/ukelonn.db.postgresql/src/main/java/no/priv/bang/ukelonn/db/postgresql/PGUkelonnDatabaseProvider.java#L42
https://github.com/steinarb/ukelonn/blob/master/ukelonn.db.postgresql/src/main/resources/db-changelog/sql/initial_users.sql
https://github.com/steinarb/ukelonn/tree/master/ukelonn.db.postgresql/src/main/resources/db-changelog/sql
https://github.com/steinarb/ukelonn/blob/master/ukelonn.db.postgresql/src/main/resources/db-changelog/sql/initial_transaction_types.sql
