• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why dynamically loaded JDBC drivers can't be registered with DriverManager?

 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I met quite interesting problem. I'm writing SQL explorer which is capable dynamically load JDBC drivers, connect to different data sources and run queries. So I found that it is not problem to register any driver which a classpath is included to boot classpath, however for dynamically loading drivers I have to create own DriverManager with own registry. Do I do something wrong, or it supposes to behavior in this way by design?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a security aspect of the JDBC part of Java.

Another way to do it is to search for a JDBC library wrapper on the internet. I can't remember where I saw it, but Java loads the wrapper from the classpath and is happy, and the wrapper manages the link between the DriverManager and the problem driver.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic