MysqlDataSourceFactory implements DataSourceFactory { @Override public DataSource createDataSource(Properties props) throws SQLException { MysqlDataSource ds = new MysqlDataSource(); setProperties(ds, props); return ds; }  @Override DataSource createDataSource(Properties props); @Override ConnectionPoolDataSource createConnectionPoolDataSource(Properties props); @Override XADataSource createXADataSource(Properties props); @Override Driver createDriver(Properties props);  }
@Test public void configuration() throws SQLException { Properties properties = new Properties(); properties.setProperty("url", "jdbc:mysql: properties.setProperty("callableStmtCacheSize", "42"); DataSource ds = new MysqlDataSourceFactory().createDataSource(properties); MysqlDataSource mds = (MysqlDataSource) ds; assertThat(mds.getCallableStmtCacheSize(), equalTo(42)); }