commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <j...@apache.org>
Subject [jira] Reopened: (DBCP-203) Want to provide a ClassLoader for BasicDataSource to use for loading a JDBC driver.
Date Tue, 11 May 2010 10:30:45 GMT

     [ https://issues.apache.org/jira/browse/DBCP-203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Phil Steitz reopened DBCP-203:
------------------------------


IIUC what is going on, DBCP-333 is pointing to a bug in the implementation of this feature.

> Want to provide a ClassLoader for BasicDataSource to use for loading a JDBC driver.
> -----------------------------------------------------------------------------------
>
>                 Key: DBCP-203
>                 URL: https://issues.apache.org/jira/browse/DBCP-203
>             Project: Commons Dbcp
>          Issue Type: New Feature
>    Affects Versions: 1.2.1
>            Reporter: Mark Grand
>            Assignee: Mark Thomas
>            Priority: Minor
>             Fix For: 1.3
>
>
> 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);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message