Source:
<code>private void createConnectionPool(String url, String user, String propertyKey, Properties properties) throws SQLException, ClassNotFoundException, IOException { String driverClass = properties.getProperty(DRIVER_KEY); if (driverClass != null && (driverClass.equals("com.facebook.presto.jdbc.PrestoDriver") || driverClass.equals("io.prestosql.jdbc.PrestoDriver"))) { Properties newProperties = new Properties(); try { Class clazz = null; try { clazz = Class.forName("com.facebook.presto.jdbc.ConnectionProperties"); } catch (ClassNotFoundException e) { clazz = Class.forName("io.prestosql.jdbc.ConnectionProperties"); } <START> Method lookUpKeyMethod = clazz.getMethod("forKey", String.class); <END> lookUpKeyMethod.setAccessible(true); for (Object key : properties.keySet()) { if (lookUpKeyMethod.invoke(null, key.toString()) != null) { newProperties.put(key, properties.get(key)); } } properties = newProperties; } catch (Throwable e) { throw new IOException("Fail to create properties for presto", e); } } ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(url, properties); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory( connectionFactory, null); final String maxConnectionLifetime = StringUtils.defaultIfEmpty(getProperty("zeppelin.jdbc.maxConnLifetime"), "-1"); poolableConnectionFactory.setMaxConnLifetimeMillis(Long.parseLong(maxConnectionLifetime)); poolableConnectionFactory.setValidationQuery("show databases"); ObjectPool connectionPool = new GenericObjectPool(poolableConnectionFactory); poolableConnectionFactory.setPool(connectionPool); Class.forName(driverClass); PoolingDriver driver = new PoolingDriver(); driver.registerPool(propertyKey + user, connectionPool); getJDBCConfiguration(user).saveDBDriverPool(propertyKey, driver); }</code><technical_language>I foresee removing properties, compatibility seriously. I main issue validation of arbitrary properties, Zeppelin adding properties "url". If avoid that, need worry validation</technical_language>

Target:
private void createConnectionPool(String url, String user, String propertyKey, Properties properties) throws SQLException, ClassNotFoundException, IOException { String driverClass = properties.getProperty(DRIVER_KEY); if (driverClass != null && (driverClass.equals("com.facebook.presto.jdbc.PrestoDriver") || driverClass.equals("io.prestosql.jdbc.PrestoDriver"))) { for (Object key : properties.keySet()) { if (!PRESTO_PROPERTIES.contains(key.toString())) { properties.remove(key); } } } ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(url, properties); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory( connectionFactory, null); final String maxConnectionLifetime = StringUtils.defaultIfEmpty(getProperty("zeppelin.jdbc.maxConnLifetime"), "-1"); poolableConnectionFactory.setMaxConnLifetimeMillis(Long.parseLong(maxConnectionLifetime)); poolableConnectionFactory.setValidationQuery("show databases"); ObjectPool connectionPool = new GenericObjectPool(poolableConnectionFactory); poolableConnectionFactory.setPool(connectionPool); Class.forName(driverClass); PoolingDriver driver = new PoolingDriver(); driver.registerPool(propertyKey + user, connectionPool); getJDBCConfiguration(user).saveDBDriverPool(propertyKey, driver); }