Commons Dbcp
  1. Commons Dbcp
  2. DBCP-203

Want to provide a ClassLoader for BasicDataSource to use for loading a JDBC driver.

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 1.3
    • Labels:
      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);

        Issue Links

          Activity

          Mark Thomas made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Phil Steitz made changes -
          Link This issue blocks DBCP-333 [ DBCP-333 ]
          Phil Steitz made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Phil Steitz made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Mark Thomas made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Mark Thomas made changes -
          Assignee Mark Thomas [ markt ]
          Phil Steitz made changes -
          Field Original Value New Value
          Fix Version/s 1.3 [ 12311977 ]
          Affects Version/s 1.2.1 [ 12311975 ]
          Mark Grand created issue -

            People

            • Assignee:
              Mark Thomas
              Reporter:
              Mark Grand
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development