Class DriverLoader
java.lang.Object
org.owasp.dependencycheck.data.nvdcve.DriverLoader
DriverLoader is a utility class that is used to load database drivers.
- Author:
- Jeremy Long
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidDe-registers the driver.static DriverLoads the specified class using the system class loader and registers the driver with the driver manager.static DriverLoads the specified class by registering the supplied paths to the class loader and then registers the driver with the driver manager.
-
Method Details
-
cleanup
De-registers the driver.- Parameters:
driver- the driver to de-register
-
load
Loads the specified class using the system class loader and registers the driver with the driver manager.- Parameters:
className- the fully qualified name of the desired class- Returns:
- the loaded Driver
- Throws:
DriverLoadException- thrown if the driver cannot be loaded
-
load
Loads the specified class by registering the supplied paths to the class loader and then registers the driver with the driver manager. The pathToDriver argument is added to the class loader so that an external driver can be loaded. Note, the pathToDriver can contain a semi-colon separated list of paths so any dependencies can be added as needed. If a path in the pathToDriver argument is a directory all files in the directory are added to the class path.- Parameters:
className- the fully qualified name of the desired classpathToDriver- the path to the JAR file containing the driver; note, this can be a semi-colon separated list of paths- Returns:
- the loaded Driver
- Throws:
DriverLoadException- thrown if the driver cannot be loaded
-