int defaultTransactionIsolation = dataSourceInformation.getDefaultTransactionIsolation();
if (DataSourceInformation.BASIC_DATA_SOURCE.equals(dsType)) {
BasicDataSource basicDataSource = new BasicDataSource();
basicDataSource.setDriverClassName(driver);
basicDataSource.setUrl(url);
if (user != null && !"".equals(user)) {
basicDataSource.setUsername(user);
}
if (password != null && !"".equals(password)) {
basicDataSource.setPassword(password);
}
basicDataSource.setMaxActive(dataSourceInformation.getMaxActive());
basicDataSource.setMaxIdle(dataSourceInformation.getMaxIdle());
basicDataSource.setMaxWait(dataSourceInformation.getMaxWait());
basicDataSource.setMinIdle(dataSourceInformation.getMinIdle());
basicDataSource.setDefaultAutoCommit(dataSourceInformation.isDefaultAutoCommit());
basicDataSource.setDefaultReadOnly(dataSourceInformation.isDefaultReadOnly());
basicDataSource.setTestOnBorrow(dataSourceInformation.isTestOnBorrow());
basicDataSource.setTestOnReturn(dataSourceInformation.isTestOnReturn());
basicDataSource.setTestWhileIdle(dataSourceInformation.isTestWhileIdle());
basicDataSource.setMinEvictableIdleTimeMillis(
dataSourceInformation.getMinEvictableIdleTimeMillis());
basicDataSource.setTimeBetweenEvictionRunsMillis(
dataSourceInformation.getTimeBetweenEvictionRunsMillis());
basicDataSource.setNumTestsPerEvictionRun(
dataSourceInformation.getNumTestsPerEvictionRun());
basicDataSource.setMaxOpenPreparedStatements(
dataSourceInformation.getMaxOpenPreparedStatements());
basicDataSource.setAccessToUnderlyingConnectionAllowed(
dataSourceInformation.isAccessToUnderlyingConnectionAllowed());
basicDataSource.setInitialSize(dataSourceInformation.getInitialSize());
basicDataSource.setPoolPreparedStatements(
dataSourceInformation.isPoolPreparedStatements());
if (defaultTransactionIsolation != -1) {
basicDataSource.setDefaultTransactionIsolation(defaultTransactionIsolation);
}
String defaultCatalog = dataSourceInformation.getDefaultCatalog();
if (defaultCatalog != null && !"".equals(defaultCatalog)) {
basicDataSource.setDefaultCatalog(defaultCatalog);
}
String validationQuery = dataSourceInformation.getValidationQuery();
if (validationQuery != null && !"".equals(validationQuery)) {
basicDataSource.setValidationQuery(validationQuery);
}
return basicDataSource;
} else if (DataSourceInformation.PER_USER_POOL_DATA_SOURCE.equals(dsType)) {