title: Start the H2 database in server mode via Spring
body: <p>I'm trying to start the H2 database in <strong>server mode</strong> (I want it to run in a different process) via Spring.
  Currently I'm using java Runnable.exec to start the h2 database (using the command: "<em>java -cp h2.jar org.h2.tools.Server</em>")</p>
  
  <p>I know that there is a way to do it via Spring. I tried to add the following to the spring configuration, but it didn't work (it didn't start the H2 database):</p>
  
  <pre><code>    &lt;bean id="org.h2.tools.Server" class="org.h2.tools.Server"
          factory-method="createTcpServer" init-method="start" destroy-method="stop"&gt;
          &lt;constructor-arg value="-tcp,-tcpAllowOthers,true,-tcpPort,8043" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="org.h2.tools.Server-WebServer" class="org.h2.tools.Server"
          factory-method="createWebServer" init-method="start"&gt;
          &lt;constructor-arg value="-web,-webAllowOthers,true,-webPort,8082" /&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>I would appreciate any help/ideas</p>