title: Does Spring's JDBCTemplate properly closes connections when manually instantiated?
body: <p>I'm using Spring Boot 2.1 RC1 and i have this method that generates a <code>JDBCTemplate</code> object based on properties defined in a database:</p>
  
  <pre><code>public JdbcTemplate generateDatasource(Environment env){
  
          String url = String.format("jdbc:oracle:thin:@//%s:%s/%s",env.getIp(), env.getPort(), env.getSid());
  
          return new JdbcTemplate(
                  DataSourceBuilder.create()
                          .url(url)
                          .username(env.getUser())
                          .password(env.getPassword())
                          .driverClassName(driver)
                          .build()
          );
  
      }
  </code></pre>
  
  <p>I notice it logs "Hikari Pool started" everytime this method is called and this makes me worry about memory leaks. The variable that holds the returned object is a local variable so i know the Garbage Collector gets rid of it. Can i be sure JDBC connections will be closed after executing some queries?</p>