title: Why do I need to specify schema for JdbcTemplate
body: <p>Here is the datasource spec in the application.properties</p>
  
  <pre><code>spring.dw.datasource.jdbc-url=jdbc:h2:tcp://localhost/file:~/developer/myprojects;schema=DW;FILE_LOCK=SOCKET;MVCC=true
  spring.dw.datasource.driver-class-name=org.h2.Driver
  spring.dw.datasource.username=me
  spring.dw.datasource.password=p
  spring.dw.datasource.platform=h2
  </code></pre>
  
  <p>In my configuration I do:</p>
  
  <pre><code>@Configuration
  public class DatasourceConfiguration {
      //...
  
      @Bean
      @ConfigurationProperties(prefix="spring.dw.database")
      public DataSource dwDatasource(){
          return DataSourceBuilder.create().build();
      }
  </code></pre>
  
  <p>In one of my services methods I do:</p>
  
  <pre><code>@Autowired
  public DataSource dwDatasource;
  
  public void run() {
      JdbcTemplate jdbcTemplate = new JdbcTemplate(dwDatasource);
      jdbcTemplate.update("INSERT INTO SAMPLETABLE1 (STRING1, STRING2) VALUES ('TEST4', 'TEST2')");
          System.out.println("&lt;&lt;run()");
      }
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code> StatementCallback; bad SQL grammar [INSERT INTO SAMPLETABLE1 (STRING1, STRING2) VALUES ('TEST4', 'TEST2')]; nested exception is org.h2.jdbc.JdbcSQLException: Table "SAMPLETABLE1" not found; SQL statement:
  </code></pre>
  
  <p>However, if I do:</p>
  
  <pre><code>public void run() {
      JdbcTemplate jdbcTemplate = new JdbcTemplate(dwDatasource);
      jdbcTemplate.update("INSERT INTO DW.SAMPLETABLE1 (STRING1, STRING2) VALUES ('TEST4', 'TEST2')");
          System.out.println("&lt;&lt;run()");
      }
  </code></pre>
  
  <p>All works.</p>
  
  <p>So question, is why should I have to specify schema</p>