@Override public Connection createConnection() throws SQLException { Driver driver; try { driver = (Driver) P6Util.forName(getDriverClassName()).newInstance(); } catch (Exception e) { throw new RuntimeException(e); } return new DriverConnectionFactory(driver, getUrl(), connectionProperties).createConnection(); } };
protected ConnectionFactory createConnectionFactory() throws SQLException { try { Driver driver = HiveDriver.class.newInstance(); // Can't test without a validationQuery if (validationQuery == null) { setTestOnBorrow(false); setTestOnReturn(false); setTestWhileIdle(false); } // Set up the driver connection factory we will use String user = username; if (user != null) { connectionProperties.put("user", user); } else { log("DBCP DataSource configured without a 'username'"); } String pwd = password; if (pwd != null) { connectionProperties.put("password", pwd); } else { log("DBCP DataSource configured without a 'password'"); } ConnectionFactory driverConnectionFactory = new DriverConnectionFactory(driver, url, connectionProperties); return driverConnectionFactory; } catch (Throwable x) { LOG.warn("Got exception trying to instantiate connection factory. Trying default instantiation", x); return super.createConnectionFactory(); } }
ConnectionFactory driverConnectionFactory = new DriverConnectionFactory(driver, url, connectionProperties); return driverConnectionFactory;
ConnectionFactory driverConnectionFactory = new DriverConnectionFactory(driver, url, connectionProperties); return driverConnectionFactory;
ConnectionFactory driverConnectionFactory = new DriverConnectionFactory(driver, url, connectionProperties); return driverConnectionFactory;
ConnectionFactory driverConnectionFactory = new DriverConnectionFactory(driver, url, connectionProperties); return driverConnectionFactory;
DriverConnectionFactory driverConnectionFactory = new DriverConnectionFactory(driver, url, connectionProperties);
DriverConnectionFactory driverConnectionFactory = new DriverConnectionFactory(driver, url, connectionProperties);
new DriverConnectionFactory(driver, url, connectionProperties);