List of usage examples for org.apache.commons.dbcp2 PoolingDriver PoolingDriver
public PoolingDriver()
From source file:org.apache.zeppelin.jdbc.JDBCInterpreter.java
private void createConnectionPool(String url, String user, String propertyKey, Properties properties) throws SQLException, ClassNotFoundException { ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(url, properties); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory, null);//from w ww .j av a 2 s . c o m ObjectPool connectionPool = new GenericObjectPool(poolableConnectionFactory); poolableConnectionFactory.setPool(connectionPool); Class.forName(properties.getProperty(DRIVER_KEY)); PoolingDriver driver = new PoolingDriver(); driver.registerPool(propertyKey + user, connectionPool); getJDBCConfiguration(user).saveDBDriverPool(propertyKey, driver); }