Uses DriverManager.
192674
private Connection getDerbyConnection(String wkpDir) {
		// See your driver documentation for the proper format of this string :
		wkpDir = wkpDir.replaceAll("\\\\", "/");
		System.err.println(wkpDir);
		String DB_CONN_STRING = "jdbc:derby:" + wkpDir // "d:/workspace/workspace-next-work/nextreports-server/data/workspaces/default"
				+ "/db;create=false";
		// Provided by your driver documentation. In this case, a MySql driver
		// is used :

		String DRIVER_CLASS_NAME = "org.apache.derby.jdbc.EmbeddedDriver";
		String USER_NAME = null;
		String PASSWORD = null;

		Connection result = null;
		try {
			Class.forName(DRIVER_CLASS_NAME).newInstance();
		} catch (Exception ex) {
			LOG.debug("Check classpath. Cannot load db driver: " + DRIVER_CLASS_NAME);
		}

		try {
			result = DriverManager.getConnection(DB_CONN_STRING, USER_NAME, PASSWORD);
		} catch (SQLException e) {
			LOG.debug("Driver loaded, but cannot connect to db: " + DB_CONN_STRING);
		}
		return result;
	}
956425
@Override
  public void run() {
    try {
      // Change state and inform the Driver
      this.taskLifeCycleHandlers.beforeTaskStart();

      LOG.log(Level.FINEST, "Informing registered EventHandler<TaskStart>.");
      this.currentStatus.setRunning();

      // Call Task.call()
      final byte[] result = this.runTask();

      // Inform the Driver about it
      this.currentStatus.setResult(result);

      LOG.log(Level.FINEST, "Informing registered EventHandler<TaskStop>.");
      this.taskLifeCycleHandlers.afterTaskExit();

    } catch (final TaskStartHandlerFailure taskStartHandlerFailure) {
      LOG.log(Level.WARNING, "Caught an exception during TaskStart handler execution.", taskStartHandlerFailure);
      this.currentStatus.setException(taskStartHandlerFailure.getCause());
    } catch (final TaskStopHandlerFailure taskStopHandlerFailure) {
      LOG.log(Level.WARNING, "Caught an exception during TaskStop handler execution.", taskStopHandlerFailure);
      this.currentStatus.setException(taskStopHandlerFailure.getCause());
    } catch (final TaskCallFailure e) {
      LOG.log(Level.WARNING, "Caught an exception during Task.call().", e.getCause());
      this.currentStatus.setException(e);
    }
  }
1159031
Driver provideHiveDriver() {
    HiveConf hiveConf = provideHiveConf();
    SessionState.start(hiveConf);

    return new Driver(hiveConf);
  }
618099
public static void main(final String[] args) throws InjectionException {

    LOG.log(Level.FINE, "Launching Unmanaged AM: {0}", JAR_PATH);

    try (final DriverLauncher client = DriverLauncher.getLauncher(RUNTIME_CONFIG)) {

      final String appId = client.submit(DRIVER_CONFIG, 10000);
      LOG.log(Level.INFO, "Job submitted: {0}", appId);

      final Configuration yarnAmConfig = UnmanagedAmYarnDriverConfiguration.CONF
          .set(UnmanagedAmYarnDriverConfiguration.JOB_IDENTIFIER, appId)
          .set(UnmanagedAmYarnDriverConfiguration.JOB_SUBMISSION_DIRECTORY, DRIVER_ROOT_PATH)
          .build();

      try (final REEFEnvironment reef = REEFEnvironment.fromConfiguration(yarnAmConfig, DRIVER_CONFIG)) {
        reef.run();
        final ReefServiceProtos.JobStatusProto status = reef.getLastStatus();
        LOG.log(Level.INFO, "REEF job {0} completed: state {1}", new Object[] {appId, status.getState()});
      }
    }

    ThreadLogger.logThreads(LOG, Level.FINEST, "Threads running after DriverLauncher.close():");
    System.exit(0); // TODO[REEF-1715]: Should be able to exit cleanly at the end of main()
  }
166681
def attach_kernel_driver(self, interface):
        
        """
        self._ctx.managed_open()
        self._ctx.backend.attach_kernel_driver(
            self._ctx.handle,
            interface)
1148340
private static void loadDriver(final String driver) throws FactoryException {

        // assert in private method
        assert driver != null : "The driver cannot be null";

        LOG.debug("Loading the database driver '" + driver + "'");

        // make sure the driver is available
        try {
            Class.forName(driver);
        } catch (ClassNotFoundException e) {
            final String error = "Error loading JDBC driver class: " + driver;
            LOG.warn(error, e);
            throw new FactoryException(error, e);
        }
    }
1228363
def clean_up_webdrivers(self):
        '''
        
        '''
        # Quit webdrivers.
        _wtflog.info("WebdriverManager: Cleaning up webdrivers")
        try:
            if self.__use_shutdown_hook:
                for key in self.__registered_drivers.keys():
                    for driver in self.__registered_drivers[key]:
                        try:
                            _wtflog.debug(
                                "Shutdown hook closing Webdriver for thread: %s", key)
                            driver.quit()
                        except:
                            pass
        except:
            pass
1088745
public static Driver driver( String uri, Config config )
    {
        return driver( URI.create( uri ), config );
    }
335552
public void contextDestroyed(ServletContextEvent arg0) {
		Iterator<Driver> drivers = DriverManager.getDrivers();
		while (drivers.hasNext()) {
			Driver driver = drivers.next();
			DriverManager.deregisterDriver(driver);
			DriverImpl impl = (DriverImpl) driver;
			impl.shutdown();
		}
	}
1233546
def make_driver(self, driver_name='generic'):
        """"""
        module_str = 'condoor.drivers.%s' % driver_name
        try:
            __import__(module_str)
            module = sys.modules[module_str]
            driver_class = getattr(module, 'Driver')
        except ImportError as e:  # pylint: disable=invalid-name
            print("driver name: {}".format(driver_name))
            self.chain.connection.log("Import error: {}: '{}'".format(driver_name, str(e)))
            # no driver - call again with default 'generic'
            return self.make_driver()

        self.chain.connection.log("Make Device: {} with Driver: {}".format(self, driver_class.platform))
        return driver_class(self)
1200024
def startLoop(self, useDriverLoop):
        '''
        
        '''
        if useDriverLoop:
            self._driver.startLoop()
        else:
            self._iterator = self._driver.iterate()
192869
private Class<?> attemptFromContextLoader(final String driverClassName) {
      final ClassLoader threadContextClassLoader = Thread.currentThread().getContextClassLoader();
      if (threadContextClassLoader != null) {
         try {
            final Class<?> driverClass = threadContextClassLoader.loadClass(driverClassName);
            LOGGER.debug("Driver class {} found in Thread context class loader {}", driverClassName, threadContextClassLoader);
            return driverClass;
         } catch (ClassNotFoundException e) {
            LOGGER.debug("Driver class {} not found in Thread context class loader {}, trying classloader {}",
               driverClassName, threadContextClassLoader, this.getClass().getClassLoader());
         }
      }

      return null;
   }
538606
private function createDriver()
    {
        if (is_string($this->config['driver'])) {
            $drivername = ucfirst($this->config['driver']);
            $driverclass = sprintf('Intervention\\Image\\%s\\Driver', $drivername);

            if (class_exists($driverclass)) {
                return new $driverclass;
            }

            throw new \Intervention\Image\Exception\NotSupportedException(
                "Driver ({$drivername}) could not be instantiated."
            );
        }

        if ($this->config['driver'] instanceof AbstractDriver) {
            return $this->config['driver'];
        }

        throw new \Intervention\Image\Exception\NotSupportedException(
            "Unknown driver type."
        );
    }
816596
private static Connection createConnection(String driver, String url, String user, String password)
            throws SQLException, ClassNotFoundException {
        Class.forName(driver);
        return DriverManager.getConnection(url, user, password);
    }
270867
Connection getConnection() throws ClassNotFoundException, SQLException{

    Class.forName(job.get(DBConfiguration.DRIVER_CLASS_PROPERTY));

    if(job.get(DBConfiguration.USERNAME_PROPERTY) == null) {
      return DriverManager.getConnection(job.get(DBConfiguration.URL_PROPERTY));
    } else {
      return DriverManager.getConnection(
          job.get(DBConfiguration.URL_PROPERTY), 
          job.get(DBConfiguration.USERNAME_PROPERTY), 
          job.get(DBConfiguration.PASSWORD_PROPERTY));
    }
  }
1165609
function () {
			winble.deviceManager.connectionWatcher = Windows.Devices.Enumeration.Pnp.PnpObject.createWatcher(
				Windows.Devices.Enumeration.Pnp.PnpObjectType.deviceContainer,
				["System.Devices.Connected"],
				"");
			winble.deviceManager.connectionWatcher.onupdated = winble.deviceManager.onDeviceConnectionUpdated;
			winble.deviceManager.connectionWatcher.start();
		}
857803
public function stop(): DriverInterface
    {
        if ($this->process) {
            $this->process->stop();
            unset($this->process);
        }

        return $this;
    }