aspose file tools
The moose likes JDBC and the fly likes Loading JDBC Driver with Custom Class Loader Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Loading JDBC Driver with Custom Class Loader" Watch "Loading JDBC Driver with Custom Class Loader" New topic
Author

Loading JDBC Driver with Custom Class Loader

Praveen Balaji
Ranch Hand

Joined: Jun 17, 2001
Posts: 60
Hi,
I am using a custom class loader to load jars. I am trying to load drivers using this custom class loader.
custmClassLoader.loadClass(driver).newInstance();
DriverManager.getDriver(url);
custmClassLoader.loadClass(driver).newInstance();
registers the driver successfully.
The custmClassLoader object delegates the searches its repository and if the class is not found, delegates the work to the System Classloader (like Tomcat).
Any help on this will be greatly appreciated.
Regards,
Praveen.
Col Bell
Greenhorn

Joined: Mar 21, 2002
Posts: 12
java.sql.DriverManager doesn't handle JDBC drivers that are loaded from a custom classloader. To get around this I wrote my own driver manager. You can have a look at it here


Col<br /><a href="http://www.squirrelsql.org" target="_blank" rel="nofollow">http://www.squirrelsql.org</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Loading JDBC Driver with Custom Class Loader
 
Similar Threads
Custom Class oader
Custome Class Loader
Problem using custom ClassLoader
Class.forName()
ClassLoader