title: In Spring Starter Project, Values are not fetching into h2 database
body: <p>I'm new to Spring Framework. While Creating Spring Starter Project, I've selected Web,JPA &amp; H2 database then I've created Alien.Class with 2 Variables and i've created data.sql file, by using this file i've tried to fetch the values into h2 database. But after adding data.sql file, i got an error that shows Failed to execute SQL script statement nested exception is Table &quot;ALIEN&quot; not found; SQL statement: insert into alien values (101, 'Vikram').Please, give a solution for this.</p>
  <p>1.Alien.Class</p>
  <pre><code>package com.telusko.demo.model;
  
  import javax.persistence.Entity;
  import javax.persistence.Id;
  
  @Entity
  public class Alien 
  {
      @Id
      private int aid;
      private String aname;
      public int getAid() {
          return aid;
      }
      public void setAid(int aid) {
          this.aid = aid;
      }
      public String getAname() {
          return aname;
      }
      public void setAname(String aname) {
          this.aname = aname;
      }
      @Override
      public String toString() {
          return &quot;Alien [aid=&quot; + aid + &quot;, aname=&quot; + aname + &quot;]&quot;;
      }
  }
  </code></pre>
  <p>2.home.jsp</p>
  <pre><code>&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=ISO-8859-1&quot;
      pageEncoding=&quot;ISO-8859-1&quot;%&gt;
  &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=ISO-8859-1&quot;&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
          &lt;form action=&quot;addAlien&quot;&gt;
              &lt;input type=&quot;text&quot; name=&quot;aid&quot;&gt;&lt;br&gt;
              &lt;input type=&quot;text&quot; name=&quot;aname&quot;&gt;&lt;br&gt;
              &lt;input type=&quot;submit&quot;&gt;
          &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>3.AlienController</p>
  <pre><code>ackage com.telusko.demo.controller;
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  
  @Controller
  public class AlienController 
  {
      @RequestMapping(&quot;/&quot;)
      public String home()
      {
          return &quot;home.jsp&quot;;
      }
  }
  </code></pre>
  <p>4.application.properties</p>
  <pre><code>server.port=8082
  spring.profiles.active=@spring.profiles.active@
  spring.h2.console.enabled=true
  spring.datasource.platform=h2
  spring.datasource.url=jdbc:h2:mem:navin
  spring.jpa.open-in-view=false
  </code></pre>
  <p>5.data.sql</p>
  <pre><code>insert into alien values (101,'Navin');
  </code></pre>
  <p>6.Console error</p>
  <pre><code>[2m2021-05-31 07:17:51.919[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.telusko.demo.BootjpaApplication     [0;39m [2m:[0;39m Starting BootjpaApplication using Java 15.0.2 on DESKTOP-JF5BSMC with PID 2788 (C:\Users\Lakshmana Sai\SpringWorkspace\bootjpa\target\classes started by Lakshmana Sai in C:\Users\Lakshmana Sai\SpringWorkspace\bootjpa)
  [2m2021-05-31 07:17:51.923[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.telusko.demo.BootjpaApplication     [0;39m [2m:[0;39m The following profiles are active: @spring.profiles.active@
  [2m2021-05-31 07:17:52.856[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36m.s.d.r.c.RepositoryConfigurationDelegate[0;39m [2m:[0;39m Bootstrapping Spring Data JPA repositories in DEFAULT mode.
  [2m2021-05-31 07:17:52.876[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36m.s.d.r.c.RepositoryConfigurationDelegate[0;39m [2m:[0;39m Finished Spring Data repository scanning in 8 ms. Found 0 JPA repository interfaces.
  [2m2021-05-31 07:17:53.672[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.b.w.embedded.tomcat.TomcatWebServer [0;39m [2m:[0;39m Tomcat initialized with port(s): 8082 (http)
  [2m2021-05-31 07:17:53.690[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.apache.catalina.core.StandardService  [0;39m [2m:[0;39m Starting service [Tomcat]
  [2m2021-05-31 07:17:53.691[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36morg.apache.catalina.core.StandardEngine [0;39m [2m:[0;39m Starting Servlet engine: [Apache Tomcat/9.0.46]
  [2m2021-05-31 07:17:54.111[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36morg.apache.jasper.servlet.TldScanner    [0;39m [2m:[0;39m At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
  [2m2021-05-31 07:17:54.124[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.a.c.c.C.[Tomcat].[localhost].[/]      [0;39m [2m:[0;39m Initializing Spring embedded WebApplicationContext
  [2m2021-05-31 07:17:54.124[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36mw.s.c.ServletWebServerApplicationContext[0;39m [2m:[0;39m Root WebApplicationContext: initialization completed in 2125 ms
  [2m2021-05-31 07:17:54.166[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.zaxxer.hikari.HikariDataSource      [0;39m [2m:[0;39m HikariPool-1 - Starting...
  [2m2021-05-31 07:17:54.462[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.zaxxer.hikari.HikariDataSource      [0;39m [2m:[0;39m HikariPool-1 - Start completed.
  [2m2021-05-31 07:17:54.476[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.b.a.h2.H2ConsoleAutoConfiguration   [0;39m [2m:[0;39m H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:navin'
  [2m2021-05-31 07:17:54.680[0;39m [33m WARN[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36mConfigServletWebServerApplicationContext[0;39m [2m:[0;39m Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scriptDataSourceInitializer' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceInitializationConfiguration$SharedCredentialsDataSourceInitializationConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement #1 of URL [file:/C:/Users/Lakshmana%20Sai/SpringWorkspace/bootjpa/target/classes/data.sql]: insert into alien values (101,'Navin'); nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Table &quot;ALIEN&quot; not found; SQL statement:
  insert into alien values (101,'Navin') [42102-200]
  [2m2021-05-31 07:17:54.682[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.zaxxer.hikari.HikariDataSource      [0;39m [2m:[0;39m HikariPool-1 - Shutdown initiated...
  [2m2021-05-31 07:17:54.693[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.zaxxer.hikari.HikariDataSource      [0;39m [2m:[0;39m HikariPool-1 - Shutdown completed.
  [2m2021-05-31 07:17:54.705[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.apache.catalina.core.StandardService  [0;39m [2m:[0;39m Stopping service [Tomcat]
  [2m2021-05-31 07:17:54.745[0;39m [32m INFO[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36mConditionEvaluationReportLoggingListener[0;39m [2m:[0;39m 
  
  Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
  [2m2021-05-31 07:17:54.844[0;39m [31mERROR[0;39m [35m2788[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.boot.SpringApplication              [0;39m [2m:[0;39m Application run failed
  
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scriptDataSourceInitializer' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceInitializationConfiguration$SharedCredentialsDataSourceInitializationConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement #1 of URL [file:/C:/Users/Lakshmana%20Sai/SpringWorkspace/bootjpa/target/classes/data.sql]: insert into alien values (101,'Navin'); nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Table &quot;ALIEN&quot; not found; SQL statement:
  insert into alien values (101,'Navin') [42102-200]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1786) ~[spring-beans-5.3.7.jar:5.3.7]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602) ~[spring-beans-5.3.7.jar:5.3.7]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.7.jar:5.3.7]
      at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.7.jar:5.3.7]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.7.jar:5.3.7]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.7.jar:5.3.7]
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.7.jar:5.3.7]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.7.jar:5.3.7]
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.7.jar:5.3.7]
      at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.7.jar:5.3.7]
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.7.jar:5.3.7]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.7.jar:5.3.7]
      at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.0.jar:2.5.0]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.5.0.jar:2.5.0]
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:438) ~[spring-boot-2.5.0.jar:2.5.0]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:337) ~[spring-boot-2.5.0.jar:2.5.0]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1336) ~[spring-boot-2.5.0.jar:2.5.0]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1325) ~[spring-boot-2.5.0.jar:2.5.0]
      at com.telusko.demo.BootjpaApplication.main(BootjpaApplication.java:10) ~[classes/:na]
  Caused by: org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement #1 of URL [file:/C:/Users/Lakshmana%20Sai/SpringWorkspace/bootjpa/target/classes/data.sql]: insert into alien values (101,'Navin'); nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Table &quot;ALIEN&quot; not found; SQL statement:
  insert into alien values (101,'Navin') [42102-200]
      at org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScript(ScriptUtils.java:622) ~[spring-jdbc-5.3.7.jar:5.3.7]
      at org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.populate(ResourceDatabasePopulator.java:254) ~[spring-jdbc-5.3.7.jar:5.3.7]
      at org.springframework.jdbc.datasource.init.DatabasePopulatorUtils.execute(DatabasePopulatorUtils.java:49) ~[spring-jdbc-5.3.7.jar:5.3.7]
      at org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializer.runScripts(DataSourceScriptDatabaseInitializer.java:72) ~[spring-boot-2.5.0.jar:2.5.0]
      at org.springframework.boot.autoconfigure.jdbc.DataSourceInitializationConfiguration$InitializationModeDataSourceScriptDatabaseInitializer.runScripts(DataSourceInitializationConfiguration.java:204) ~[spring-boot-autoconfigure-2.5.0.jar:2.5.0]
      at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.runScripts(AbstractScriptDatabaseInitializer.java:131) ~[spring-boot-2.5.0.jar:2.5.0]
      at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.applyScripts(AbstractScriptDatabaseInitializer.java:91) ~[spring-boot-2.5.0.jar:2.5.0]
      at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.applyDataScripts(AbstractScriptDatabaseInitializer.java:85) ~[spring-boot-2.5.0.jar:2.5.0]
      at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.initializeDatabase(AbstractScriptDatabaseInitializer.java:76) ~[spring-boot-2.5.0.jar:2.5.0]
      at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.afterPropertiesSet(AbstractScriptDatabaseInitializer.java:65) ~[spring-boot-2.5.0.jar:2.5.0]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1845) ~[spring-beans-5.3.7.jar:5.3.7]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782) ~[spring-beans-5.3.7.jar:5.3.7]
      ... 18 common frames omitted
  Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table &quot;ALIEN&quot; not found; SQL statement:
  insert into alien values (101,'Navin') [42102-200]
      at org.h2.message.DbException.getJdbcSQLException(DbException.java:453) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.message.DbException.getJdbcSQLException(DbException.java:429) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.message.DbException.get(DbException.java:205) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.message.DbException.get(DbException.java:181) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.command.Parser.readTableOrView(Parser.java:7628) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.command.Parser.readTableOrView(Parser.java:7599) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.command.Parser.parseInsert(Parser.java:1747) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.command.Parser.parsePrepared(Parser.java:954) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.command.Parser.parse(Parser.java:843) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.command.Parser.parse(Parser.java:815) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.command.Parser.prepareCommand(Parser.java:738) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.engine.Session.prepareLocal(Session.java:657) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.engine.Session.prepareCommand(Session.java:595) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1235) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:212) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:201) ~[h2-1.4.200.jar:1.4.200]
      at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:94) ~[HikariCP-4.0.3.jar:na]
      at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) ~[HikariCP-4.0.3.jar:na]
      at org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScript(ScriptUtils.java:601) ~[spring-jdbc-5.3.7.jar:5.3.7]
      ... 29 common frames omitted
  </code></pre>