title: Spring Boot Data JPA with H2 and data.sql - Table not Found
body: <p>I have a Spring Boot 2.5.0 project. I'm using spring-data-jap with the h2 in-memory database. I want to populate data on startup with a data.sql file but I'm getting a table not found exception. If I remove the data.sql file, I can see that a table for my entity does get created automatically. But if I include the data.sql file, I get the error saying the table doesn't exist. Maybe it is an error with my sql syntax of I have misconfigured the h2 database?</p>
  <p><em>applicaltion.yml</em></p>
  <pre><code>spring:
    datasource:
      url: jdbc:h2:mem:test
      driverClassName: org.h2.Driver
      username: sa
      password: sa
    jpa:
      database-platform: org.hibernate.dialect.H2Dialect
  
  debug: true  
  </code></pre>
  <p><em>data.sql</em></p>
  <pre><code>INSERT INTO BUSINESS_SUMMARY VALUES (1, &quot;ALM470&quot;, &quot;B48&quot;, 3);
  </code></pre>
  <p><em>BusinessSummary.java entity</em></p>
  <pre><code>@NoArgsConstructor(access = AccessLevel.PROTECTED)
  @Getter
  @Entity
  public class BusinessSummary {
  
      @Id
      private Long id;
      private String businessId;
      private String businessDomainId;
      private Integer cityCode;
  }
  </code></pre>
  <p><em>BusinessSummaryRepository.java</em></p>
  <pre><code>@Repository
  public interface BusinessSummaryRepository extends JpaRepository&lt;BusinessSummary, Long&gt; {
  }
  </code></pre>
  <p><em>Exception:</em></p>
  <pre><code>Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table &quot;BUSINESS_SUMMARY&quot; not found; SQL statement:
  INSERT INTO BUSINESS_SUMMARY VALUES(1, &quot;ALM470&quot;, &quot;B48&quot;, 3) [42102-200]
  </code></pre>