title: cannot insert data in h2 in-memory database
body: <p>I am inserting the data in inMemory database,while inserting the data i am getting an issue,</p>
  
  <p>Sample program to insert data in inMemory using boot,JPA,H2db</p>
  
  <ul>
  <li><p>Created Pojo and annotated with JPA annotation</p></li>
  <li><p>Created data.sql file for queries.</p></li>
  <li><p>Running the application. 
  please find issue details in screenshots. </p></li>
  </ul>
  
  <p>I tried with a number of ways, but still the same exception</p>
  
  <ul>
  <li><p>Configured in app.prop: <code>String url = jdbc:h2:~/test;DB_CLOSE_ON_EXIT=FALSE</code></p></li>
  <li><p>Added <code>@Table</code> with a given table in data.sql file</p></li>
  <li><p>Added <code>@Column</code> name for conversion as mentioned in data.sql.</p></li>
  </ul>
  
  <p>Where to configured; <code>DB_CLOSE_ON_EXIT=FALSE</code> in springboot?</p>
  
  <p>POJO</p>
  
  <pre><code>@Entity
  @Table(name = "exchange_value")
  public class CurrencyExchange {
      @Id
      private Long id;
      @Column(name = "currency_from")
      private String from;
      @Column(name = "currency_to")
      private String to;
      @Column(name = "conversion_multiple")
      private BigDecimal conversion;
      private int port;
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>@Autowired
      private Environment env;
      @GetMapping("/currency-exchange/from/{from}/to/{to}")
      public CurrencyExchange retriveCurrencyExchange(@PathVariable String from,@PathVariable String to)
      {
          CurrencyExchange currencyExchange = new CurrencyExchange(1000L, from, to, BigDecimal.valueOf(65));
          currencyExchange.setPort(Integer.parseInt(env.getProperty("local.server.port")));
          return currencyExchange;
  
      }
  }
  </code></pre>
  
  <hr>
  
  <p>app.prop</p>
  
  <pre><code>spring.application.name=currency-exchange-service
  server.port=8000
  
  spring.jpa.show-sql=true
  spring.h2.console.enabled=true
  </code></pre>
  
  <hr>
  
  <pre><code>data.sql file
  
  
  
   insert into exchange_value(id,currency_from,currency_to,conversion_multiple,port)
      values(1001,'USD','INR',65,0);
      insert into exchange_value(id,currency_from,currency_to,conversion_multiple,port)
      values(1002,'EUR','INR',75,0);
  
  Output: The data should be inserted into in-memory database while hitting the service. 
  </code></pre>
  
  <hr>
  
  <blockquote>
    <p>Error Caused by: 
        Invocation of destroy method failed on bean with name 'inMemoryDatabaseShutdownExecutor': org.h2.jdbc.JdbcSQLNonTransientConnectionException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-199]
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement #1 of URL [file:/Users/naresh/Documents/workspace-sts-3.9.8.RELEASE/currency-exchange-service/target/classes/data.sql]: insert into exchange_value(id,currency_from,currency_to,conversion_multiple,port) values(1001,'USD','INR',65,0); nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "EXCHANGE_VALUE" not found; SQL statement:
        insert into exchange_value(id,currency_from,currency_to,conversion_multiple,port) values(1001,'USD','INR',65,0) [42102-199]
        org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "EXCHANGE_VALUE" not found; SQL statement:
        insert into exchange_value(id,currency_from,currency_to,conversion_multiple,port) values(1001,'USD','INR',65,0) [42102-199]</p>
  </blockquote>