title: How should I handle checked exceptions in Spring's JavaConfig?
body: <p>I am moving over some existing xml configuration to Java configuration for Spring.  During this process, I have encountered some transferred Java code that throws a checked <code>Exception</code>.</p>
  
  <pre><code>@Bean
  public PoolDataSource myDataSource()
  {
      final PoolDataSource dataSource = PoolDataSourceFactory.getPoolDataSource();
      dataSource.setConnectionPoolName("myDataSourcePoolName"); // throws SQLException
      return dataSource;
  }
  </code></pre>
  
  <p>I was wondering how I should handle it, and whether or not the Spring developers had any <em>'best practices'</em> in mind.</p>
  
  <p>Should I mark the method with a <code>throws</code> clause (which would propagate up any <code>@Import</code> chain) or should I handle it method with a <code>try</code>-<code>catch</code> block?</p>