title: How set initial size connection to postgresql in application.yml
body: <p>Always when i connect to my database, I see 10 idle connection. How can I set this in application.yml.</p>
  
  <p>I use spring boot 1.5.6.RELEASE.</p>
  
  <p>It's not working:</p>
  
  <pre><code>spring:
     datasource:
      maxActive: 5
      maxIdle: 5
      minIdle: 5
      initialSize: 5
  </code></pre>
  
  <p>When I created @Bean it's working, but I need solution in application.yml</p>
  
  <pre><code>@Configuration
  public class DBConfig {
  
      @Value("${dbconfig.driver-class-name}")
      private String driverClassName;
      @Value("${dbconfig.url}")
      private String url;
      @Value("${dbconfig.username}")
      private String username;
      @Value("${dbconfig.password}")
      private String password;
  
      @Bean
      public DataSource dataSource() throws SQLException {
          BasicDataSource ds = new BasicDataSource();
          ds.setDriverClassName(driverClassName);
          ds.setUrl(url);
          ds.setUsername(username);
          ds.setPassword(password);
          return ds;
      }
  </code></pre>