title: Spring Boot Database - Running Application with different DB User / Flyway
body: <p>i have currently an issue with my application. It is a Spring Boot Application where i am creating Database Tables via Flyway. For Flyway i created an DB User which has the sufficent rights to create DB Tables. </p>
  
  <p>For the Application i would like to use a different DB User (APP_DB_USER) which should be used to insert the Business Data.</p>
  
  <p>So far the Flyway Script is running perfectly and Tables are getting created
  I am also granting rights to the APP_DB_USER by using following command. (Schema name and User name are the same in my example)</p>
  
  <p><code>GRANT ALL ON DB_USER.TABLE1 TO APP_DB_USER;</code></p>
  
  <p>In SQL Developer i can run SELECT / INSERT Statements with the APP_DB_USER on the Tables of DB_USER (e.g DB_USER.TABLE1)</p>
  
  <p>My issue is now in the spring boot application.
  I have set:</p>
  
  <pre><code>spring:
    datasource:
      url: DB_URL
      username: APP_DB_USER 
      password: password
      driver-class-name: oracle.jdbc.OracleDriver
      initialization-mode: EMBEDDED
      hikari:
        connection-timeout: 20000
        minimum-idle : 1
        maximum-pool-size : 2
        idle-timeout: 10000
        max-lifetime: 1000
        auto-commit: true
        schema: DB_USER
  </code></pre>
  
  <p>Application is starting correctly, but as soon as i am trying to save an Entity it is giving me the error message</p>
  
  <p><code>java.sql.SQLSyntaxErrorException: ORA-00942: Table or View not found</code></p>
  
  <p>Additionally i tried following property</p>
  
  <pre><code>jpa:
      show-sql: true
      properties:
        hibernate:
          default_schema: DB_USER
          dialect: org.hibernate.dialect.Oracle12cDialect 
  </code></pre>
  
  <p>Does anybody has an idea what i am doing wrong. 
  How can i created via Flyway with an different DB_User Tables which can be then used by the Application via a different APP_DB_USER</p>