title: How to "allow remote database creation" when using h2 database?
body: <p>I'm trying to create a Spring Boot project with H2 database, which would be accessible by other programs.</p>
  <p><em>application.properties</em></p>
  <pre><code>spring.datasource.url = jdbc:h2:tcp://localhost:8084/~/./db/tech
  spring.datasource.driverClassName=org.h2.Driver
  spring.datasource.username=sa
  spring.datasource.password=
  spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
  spring.datasource.initialization-mode=always
  </code></pre>
  <p><em>SpringBootMyApplication.java</em></p>
  <pre><code>@SpringBootApplication
  public class SpringBootMyApplication{
  
      public static void main(String[] args) {
          SpringApplication.run(SpringBootMyApplication.class, args);
      }
  
      @Bean(initMethod = &quot;start&quot;, destroyMethod = &quot;stop&quot;)
      public Server h2Server() throws SQLException {
          return Server.createTcpServer(&quot;-tcp&quot;, &quot;-tcpAllowOthers&quot;, &quot;-tcpPort&quot;, &quot;8084&quot;);
      }
  
  }
  </code></pre>
  <p>The exception is:</p>
  <pre><code>Caused by: org.h2.jdbc.JdbcSQLNonTransientConnectionException: Database &quot;C:/Users/onz03589/db/tech&quot; not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-200]
  </code></pre>
  <p>How to actually &quot;allow remote database creation&quot;?</p>