scriptella.core
Class DriverFactory

java.lang.Object
  extended by scriptella.core.DriverFactory

public final class DriverFactory
extends java.lang.Object

Factory for Scriptella Service Providers and JDBC drivers.

Version:
1.0
Author:
Fyodor Kupolov

Method Summary
static ScriptellaDriver getDriver(java.lang.Class drvClass)
          Creates a Scriptella Driver using specified class.
static ScriptellaDriver getDriver(java.lang.String driverName, java.lang.ClassLoader loader)
          Loads a driver specified by a full or a short name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDriver

public static ScriptellaDriver getDriver(java.lang.String driverName,
                                         java.lang.ClassLoader loader)
                                  throws java.lang.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:
java.lang.ClassNotFoundException - if no drivers satisfy specified name.

getDriver

public static ScriptellaDriver getDriver(java.lang.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


Copyright © Copyright 2006-2009 The Scriptella Project Team.