Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.2.1
-
None
Description
I have an application that will be configured to use a JDBC driver at run time. It would be helpful if I could set the ClassLoader that BasicDataSource uses to load the JDBC driver.
I don't know what the procedure is for submitting improvements, but this is something that I could add myself. the code would look like this:
private ClassLoader driverLoader = getClass().getClassLoader();
...
public ClassLoader getDriverLoader() {
return driverLoader();
}
public void setDriverLoader(ClassLoader newValue) {
driverLoader = newValue;
}
...
Change the statement that in createDataSource from
Class.forName(driverClassName);
to be
Class.forName(driverClassName, true, driverLoader);
Attachments
Issue Links
- blocks
-
DBCP-333 Unable to create a JDBC driver using custom class loader
- Closed