title: Embedded Database for Junit Tests for non-spring application
body: <p>I am looking for a embedded database which I can use in <code>JUnit 4.12</code> tests. Because of the current nature of our code base &amp; time-lines it is not possible for us to mock the database calls. We are concerned only about Mysql database. So I am looking for some kind of Embedded database which I can initialize before our each test run &amp; then clear it after the tests. Some what similar to what <a href="http://wiremock.org/" rel="nofollow noreferrer">wiremock</a> does for http server. </p>
  
  <p>I have gone through <a href="https://stackoverflow.com/questions/2012292/spring-configuration-for-embedded-h2-database-for-tests">this</a> &amp; it seems it is possible to achieve it via H2 embedded database. Most of the links I have found in the web talks about using it with Spring. </p>
  
  <p>Can some one let me know </p>
  
  <ol>
  <li>If it is possible to achieve the same using <a href="http://www.h2database.com/html/main.html" rel="nofollow noreferrer">H2</a> as embedded database for Junit tests for non-spring application? If yes can someone let me know how to do this or point me to some link where this use case is explained?</li>
  <li>Also is there some other tools other than H2 which I can use to achieve my goals?</li>
  </ol>