title: How to avoid or ignore SQLExceptions by schema.sql at Spring Boot app startup
body: <p>I have a Spring Boot application that has an embedded in-memory Derby DB and <code>schema.sql</code> is executed by Spring Boot at startup.</p>
  
  <p>schema.sql:</p>
  
  <pre><code>create schema demo;
  create table users (id varchar(10) primary key, name varchar(30), password varchar(30), mail varchar(100));
  insert into users (id, name) values ('admin','admin');
  </code></pre>
  
  <p>I wanted to introduce <code>spring-boot-devtools</code> to automatically reload changes in my application, so I added the dependency to pom.xml.</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>However, the above SQLs causes SQLExceptions and fails to reload because the schema and table has already exist.</p>
  
  <p>So I tried to add the following SQLs, but <code>if exists</code>clause cannot be used in Derby. </p>
  
  <pre><code>drop schema if exists demo;
  drop table if exists users;
  </code></pre>
  
  <p>Could anyone tell me the solution (alternative SQLs or how to ignore the SQL exceptions)?</p>