title: spring boot not fetching data from external oracle database configured
body: <p>I want to configure oracle database with spring boot2.
  I have developed the dao layer code and unit tested with embeded H2 database successfully. But now when i provide the datasource configuration details in applicaiton.yaml file, it is not able to retrieve the data from the external oracle database. No error is getting displayed.</p>
  
  <p>Here is my configuration</p>
  
  <p><strong>pom.xml</strong> </p>
  
  <pre><code>&lt;!-- https://mvnrepository.com/artifact/org.eclipse.persistence/eclipselink --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;eclipselink&lt;/artifactId&gt;
              &lt;version&gt;2.5.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &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;!-- &lt;scope&gt;runtime&lt;/scope&gt; --&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.oracle&lt;/groupId&gt;
              &lt;artifactId&gt;ojdbc&lt;/artifactId&gt;
              &lt;version&gt;11.2.0.3&lt;/version&gt;
              &lt;scope&gt;system&lt;/scope&gt;
              &lt;systemPath&gt;${basedir}/src/main/webapp/WEB-INF/lib/ojdbc6.jar&lt;/systemPath&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p><strong>Service layer:</strong></p>
  
  <pre><code>@Autowired
  SampleActivityLogRepository repository;
  
  //inside a method
  Optional&lt;List&lt;SampleActivityLog&gt;&gt; listOfActivityForToken = repository.findLogByAccNoandTokenIDOrderByDate(userId, example.getKey());
  </code></pre>
  
  <p><strong>Repository Layer:</strong></p>
  
  <pre><code>@Repository
  @Transactional
  public interface SampleActivityLogRepository extends JpaRepository&lt;SampleActivityLog, Long&gt; {
  
      @Query("SELECT L FROM SampleActivityLog L WHERE L.accountId = ?1 AND L.userId = ?2 ORDER BY L.createdDate desc")
      Optional&lt;List&lt;SampleActivityLog&gt;&gt; findLogByAccNoandTokenIDOrderByDate(String accNo, String userId);
  }
  </code></pre>
  
  <p><strong>application.yaml:</strong></p>
  
  <pre><code>spring:
    profiles: dev
  
  logging:
    level:
      org.springframework: ERROR
      com.example.rest.Tokennotification: DEBUG
  
    datasource:
      url: jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = example.com)(PORT = 1875))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = sit)))
      username: mvcschenam
      password: support$12ab
      driverClassName: oracle.jdbc.OracleDriver
    jpa:
      database-platform: org.hibernate.dialect.Oracle10gDialect
      database: H2
      #openInView: false
      show_sql: true
      generate-ddl: false
  </code></pre>
  
  <p>What I have tried:</p>
  
  <ol>
  <li><p>I have removed the h2 dependency from the pom.xml. but it threw error no 'url' configured for datasource</p></li>
  <li><p>I have tried to remove autoconfiguration by using @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
  But it threw error that SampleActivityLogRepository is only a interface .. need to implement. But i do not see much logic here.. as the same code worked when connected to boot integrated database</p></li>
  </ol>
  
  <p>I need to connect to external database but i am not sure what i am missing. I do not want to change my code as i believe it is pretty neat and working as well.
  Please guide me what i can do here. Thanks in advance</p>