pcf.setMaxOpenPrepatedStatements(10);
pcf.setValidationQuery("SELECT COUNT(*) FROM DUAL");
pcf.setDefaultReadOnly(Boolean.FALSE);
pcf.setDefaultAutoCommit(Boolean.TRUE);
GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
poolConfig.setMaxTotal(getMaxTotal());
poolConfig.setMaxWaitMillis(getMaxWaitMillis());
poolConfig.setMinIdle(10);
poolConfig.setTestOnBorrow(true);
poolConfig.setTestOnReturn(true);
poolConfig.setTestWhileIdle(true);
poolConfig.setTimeBetweenEvictionRunsMillis(10000L);
poolConfig.setNumTestsPerEvictionRun(5);
poolConfig.setMinEvictableIdleTimeMillis(5000L);
GenericObjectPool<PoolableConnection> pool = new GenericObjectPool<>(pcf, poolConfig);
pcf.setPool(pool);
assertNotNull(pcf);