Take following steps to add embedded database support in Spring. This is required to have local in memory database for integration testing and/or local development.
Add Jar using Maven or Gradle
Add latest version of h2 database.
Add H2 as datasource
Update Spring configuration file.
Add database initialization scripts
Initialize database by adding mock-data.sql. Assumption is that you already have schema.sql which contains all the database scripts.
Java6 comes with JavaDB which can also be used as embedded database. JavaDB is a fully transactional, secure, standards-based database server, written entirely in Java, and fully supports SQL, JDBC API, and Java EE technology. JavaDB .