Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 58827 invoked from network); 22 Mar 2011 20:48:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Mar 2011 20:48:46 -0000 Received: (qmail 39862 invoked by uid 500); 22 Mar 2011 20:48:46 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 39799 invoked by uid 500); 22 Mar 2011 20:48:45 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 39791 invoked by uid 99); 22 Mar 2011 20:48:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Mar 2011 20:48:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Mar 2011 20:48:43 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id DBF6E42E67 for ; Tue, 22 Mar 2011 20:48:05 +0000 (UTC) Date: Tue, 22 Mar 2011 20:48:05 +0000 (UTC) From: "Mark Thomas (JIRA)" To: issues@commons.apache.org Message-ID: <983330953.4658.1300826885897.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (DBCP-203) Want to provide a ClassLoader for BasicDataSource to use for loading a JDBC driver. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DBCP-203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mark Thomas resolved DBCP-203. ------------------------------ Resolution: Fixed DBCP-333 is now fixed. > 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. For more information on JIRA, see: http://www.atlassian.com/software/jira