### Question:
DBUtils { public static DataSource newDataSource(Connector connector) { String driver = connector.getMetadata(Fields.JDBC_DRIVER); String url = connector.getMetadata(Fields.JDBC_URL); String username = connector.getMetadata(Fields.JDBC_USERNAME); String password = connector.getMetadata(Fields.JDBC_PASSWORD); try { SimpleDriverDataSource dataSource = new SimpleDriverDataSource(); dataSource.setDriverClass(Class.forName(driver).asSubclass(Driver.class)); dataSource.setUsername(username); dataSource.setPassword(password); dataSource.setUrl(url); return dataSource; } catch (ClassNotFoundException e) { throw new DatumCoreException(ErrorCodes.DRIVER_CLASS_NOT_FOUND, driver, e); } }  static DataSource newDataSource(Connector connector); static JdbcTemplate newJdbcTemplate(Connector connector);  }### Answer:
@Test public void testNewDataSource() throws SQLException { Connector connector = ConnectorFactory.newSampleDBConnector(); JdbcTemplate template = new JdbcTemplate(DBUtils.newDataSource(connector)); Integer number = template.queryForObject("SELECT 1", Integer.class); Assert.assertEquals(new Integer(1), number); }