title: How to embed HSQLDB in file with Spring to a WebApp
body: <p>I have a webApp with Spring and it works correctly when I use HSQLDB in server mode, but in file mode, it only passes the unit test. This is my data source:</p>
  
  <pre><code>&lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
      destroy-method="close"&gt;
      &lt;property name="driverClassName" value="org.hsqldb.jdbcDriver" /&gt;
  
       &lt;property name="url" value="jdbc:hsqldb:hsql://localhost/images" /&gt;
      &lt;property name="username" value="sa" /&gt;
      &lt;property name="password" value="" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I just change this line</p>
  
  <pre><code>   &lt;property name="url" value="jdbc:hsqldb:hsql://localhost/images" /&gt;    
     ( -- Server mode)
  </code></pre>
  
  <p>for this</p>
  
  <pre><code>     &lt;property name="url" value="jdbc:hsqldb:file:data/images" /&gt;      
       (-- In file)
  </code></pre>
  
  <p>And it just passes the unit test, and fails in the web appp.</p>
  
  <p>I suppose that in file mode, when I run the webapp, HSQLDB doesn't find the file of the database.</p>
  
  <p>I already tried to put the data of the database in the root of the webapp and inside the web-inf, and it doesn't work.</p>