title: View content of embedded H2 database started by Spring
body: <p>I would like to view in a web browser the content of the H2 database started by Spring thanks to the following configuration:</p>
  
  <pre><code>&lt;jdbc:embedded-database id="dataSource" type="H2" /&gt;
  
  &lt;jdbc:initialize-database data-source="dataSource"&gt;
      &lt;jdbc:script location="classpath:db/populateDB.sql"/&gt;
  &lt;/jdbc:initialize-database&gt;
  </code></pre>
  
  <p>I searched for the JDBC URL in the logs:</p>
  
  <pre><code>DEBUG o.s.j.d.SimpleDriverDataSource - Creating new JDBC Driver Connection to [jdbc:h2:mem:dataSource;DB_CLOSE_DELAY=-1]
  </code></pre>
  
  <p>So that I could fill the connection form as follows:</p>
  
  <p><img src="https://i.stack.imgur.com/2jIeZ.png" alt="enter image description here"></p>
  
  <p>But unfortunately, the db is still empty, whereas it shouldn't due to the populateDB.sql script.</p>
  
  <p>Any idea?</p>
  
  <p>Thanks!</p>