Data Integration Connector Toolkit
- Data Integration Connector Toolkit
- All Products
@Override public void getPoolingOptions(ConnectionPoolingOptions options){ /** * The default values are: * maxTotal = -1 * maxTotalPerKey = -1 * maxIdlePerKey = 20 * MinEvictableIdleTimeMillis = 1200000 * MaxWaitMillis = 30000 */ /* boolean supportPooling = Boolean.FALSE; boolean supportPooling = (System.getProperty(Demo4Connection_CONNECTIONPOOLING_ENABLE) == null || System.getProperty(Demo4Connection_CONNECTIONPOOLING_ENABLE).isEmpty()) ? Boolean.FALSE : Boolean.parseBoolean(System.getProperty(Demo4Connection_CONNECTIONPOOLING_ENABLE)); int maxTotal = (System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXTOTAL) == null || System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXTOTAL).isEmpty()) ? 0 : Integer.parseInt(System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXTOTAL)); int maxIdlePerKey = (System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXIDLE_PERKEY) == null || System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXIDLE_PERKEY).isEmpty()) ? 0 : Integer.parseInt(System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXIDLE_PERKEY)); int maxTotalPerKey = (System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXTOTAL_PERKEY) == null || System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXTOTAL_PERKEY).isEmpty()) ? 0 : Integer.parseInt(System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXTOTAL_PERKEY)); long minEvictableIdleTime = (System.getProperty(Demo4Connection_CONNECTIONPOOLING_MINEVICTABLE_IDLETIME_MILLIS) == null || System.getProperty(Demo4Connection_CONNECTIONPOOLING_MINEVICTABLE_IDLETIME_MILLIS).isEmpty()) ? 0 : Long.parseLong(System.getProperty(Demo4Connection_CONNECTIONPOOLING_MINEVICTABLE_IDLETIME_MILLIS)); if (supportPooling) { options.setSupportPooling(Boolean.TRUE); options.setTestOnBorrow(Boolean.TRUE); //If value is set to zero then we will use default values if (maxTotal > 0) options.setMaxTotal(maxTotal); if (maxIdlePerKey > 0) options.setMaxIdlePerKey(maxIdlePerKey); if (maxTotalPerKey > 0) options.setMaxTotalPerKey(maxTotalPerKey); if (minEvictableIdleTime > 0) options.setMinEvictableIdleTimeMillis(minEvictableIdleTime); } else { options.setSupportPooling(false); } */ }