Package scriptella.core
Class DriverFactory
java.lang.Object
scriptella.core.DriverFactory
Factory for Scriptella Service Providers and JDBC drivers.
- Version:
- 1.0
- Author:
- Fyodor Kupolov
-
Method Summary
Modifier and TypeMethodDescriptionstatic ScriptellaDriverCreates a Scriptella Driver using specified class.static ScriptellaDrivergetDriver(String driverName, ClassLoader loader) Loads a driver specified by a full or a short name.
-
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:
- Class with name
driverNameis looked up. - If class not found, a class with the following name is checked: scriptella.driver.<driverName>.Driver
- 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.
- Class with name
-
getDriver
Creates a Scriptella Driver using specified class.If class is a
DriverJDBC Bridgeis used.To be successfully instantiated the driver class must implement
ScriptellaDriverclass and has no-arg public constructor.- Parameters:
drvClass- driver class.- Returns:
- Scriptella Driver
-