Object Pooling Service 를 적용해서 데이타베이스 접속정보를 얻어온다.
Data Source Service 내부에 적용되어 있다.
GenericObjectPool connectionPool = new GenericObjectPool(null); connectionPool.setMaxActive(maxActive); connectionPool.setMaxIdle(maxIdle); connectionPool.setMaxWait(maxWait); connectionPool.setWhenExhaustedAction(whenExhaustedAction); connectionPool.setMinIdle(minIdle); connectionPool.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis); connectionPool.setTimeBetweenEvictionRunsMillis(timeBetweenEvctionRunsMillis); connectionPool.setTestOnBorrow(testOnBorrow); connectionPool.setTestOnReturn(testOnReturn); connectionPool.setTestWhileIdle(testWhileIdle); connectionPool.setNumTestsPerEvictionRun(numTestsPerEvictionRun); ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(url,user,password); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory, connectionPool, null, null, false, true); PoolingDriver poolingDriver = new PoolingDriver(); poolingDriver.registerPool("database", connectionPool);