dataSource.setValidationQuery(validationQuery);
// Set up connection pool
GenericObjectPool pool = new GenericObjectPool();
// setup factory and pooling DataSource
DataSourceConnectionFactory factory = new DataSourceConnectionFactory(dataSource);
@SuppressWarnings("unused")
PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(factory,pool,null,null,false,true);
DataSource poolingDataSource = new PoolingDataSource(pool);