use of org.apache.tomcat.jdbc.pool.DataSource in project ocvn by devgateway.
the class DatabaseConfiguration method dataSource.
/**
* Creates a {@link javax.sql.DataSource} based on Tomcat {@link DataSource}
*
* @return
*/
@Bean
@DependsOn(value = { "derbyServer" })
public DataSource dataSource() {
PoolProperties pp = new PoolProperties();
pp.setJmxEnabled(true);
pp.setDefaultTransactionIsolation(springDatasourceTransactionIsolation);
pp.setInitialSize(springDatasourceInitialSize);
pp.setMaxActive(springDatasourceMaxActive);
DataSource dataSource = new DataSource(pp);
dataSource.setUrl(springDatasourceUrl);
dataSource.setUsername(springDatasourceUsername);
dataSource.setPassword(springDatasourcePassword);
dataSource.setDriverClassName(springDatasourceDriverClassName);
return dataSource;
}
Aggregations