title: java.sql.SQLException: Driver:oracle.jdbc.driver.OracleDriver returned null for URL:jdbc:h2:/data/sample;IFEXISTS=TRUE
body: <p><strong>Disclaimer</strong>: Spring-boot noob.</p>
  
  <p>I'm trying to set up an H2 database for integration testing with spring-boot.</p>
  
  <p>I'm getting error: <code>java.sql.SQLException: Driver:oracle.jdbc.driver.OracleDriver@2e179f3e returned null for URL:jdbc:h2:/data/sample;IFEXISTS=TRUE</code></p>
  
  <p>I'm not really sure what to do here.<br>
  I have to override <code>spring.datasource.url</code> because that value is expected to be in the app.</p>
  
  <h2>FirstTest.groovy</h2>
  
  <pre><code>package com.api
  
  import groovy.util.logging.Slf4j
  import org.junit.Test
  import org.junit.runner.RunWith
  import org.springframework.boot.test.IntegrationTest
  import org.springframework.boot.test.SpringApplicationConfiguration
  import org.springframework.test.context.junit4.SpringJUnit4ClassRunner
  
  @RunWith(SpringJUnit4ClassRunner.class)
  @SpringApplicationConfiguration(classes = Api.class)
  @IntegrationTest(value = "spring.profiles.active=h2")
  @Slf4j
  class FirstTest {
  
  
      @Test
      void test() {
          log.info 'debug log statement'
      }
  
  }
  </code></pre>
  
  <h2>src/test/resources/config/application-h2.properties</h2>
  
  <pre><code>spring.datasource.dataSourceClassName=org.h2.jdbcx.JdbcDataSource
  spring.datasource.url=jdbc:h2:/data/sample;IFEXISTS=TRUE
  spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
  spring.jpa.database=H2
  </code></pre>
  
  <h2>pom.xml</h2>
  
  <pre><code>...
  &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
  &lt;/dependency&gt;
  ...
  &lt;dependency&gt;
          &lt;groupId&gt;com.h2database&lt;/groupId&gt;
          &lt;artifactId&gt;h2&lt;/artifactId&gt;
          &lt;version&gt;1.4.189&lt;/version&gt;
  &lt;/dependency&gt;
  ...
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT:</strong> This post: <a href="https://stackoverflow.com/questions/24655684/spring-boot-default-h2-jdbc-connection-and-h2-console">spring boot default H2 jdbc connection (and H2 console)</a> seemed to answer my question</p>
  
  <h2>src/test/resources/config/application-h2.properties</h2>
  
  <pre><code>spring.datasource.url=jdbc:h2:mem:foo-database;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
  spring.datasource.driverClassName=org.h2.Driver
  spring.datasource.username=sa
  spring.datasource.password=
  spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
  </code></pre>