Class DriverFactory

java.lang.Object
scriptella.core.DriverFactory

public final class DriverFactory extends Object
Factory for Scriptella Service Providers and JDBC drivers.
Version:
1.0
Author:
Fyodor Kupolov
  • Method Details

    • getDriver

      public static ScriptellaDriver getDriver(String driverName, ClassLoader loader) throws ClassNotFoundException
      Loads a driver specified by a full or a short name. This method tries to lookup a driver class specified by a name.

      The looking up procedure is the following:

      1. Class with name driverName is looked up.
      2. If class not found, a class with the following name is checked: scriptella.driver.<driverName>.Driver
      3. If no classes found - an exception is raised.

      Parameters:
      driverName - driver class short or full name.
      loader - class loader to use when loading driver classes.
      Returns:
      found driver class.
      Throws:
      ClassNotFoundException - if no drivers satisfy specified name.
    • getDriver

      public static ScriptellaDriver getDriver(Class drvClass)
      Creates a Scriptella Driver using specified class.

      If class is a Driver JDBC Bridge is used.

      To be successfully instantiated the driver class must implement ScriptellaDriver class and has no-arg public constructor.

      Parameters:
      drvClass - driver class.
      Returns:
      Scriptella Driver