• Post Reply Bookmark Topic Watch Topic
  • New Topic

Loading JDBC Driver with Custom Class Loader  RSS feed

 
Praveen Balaji
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!