:: JDBC Drivers and Class Loader Issue :: ~ Any body help is solicited ~
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Bhaktavatsalamreddy_Gani
Posted On:   Tuesday, August 23, 2005 04:02 AM

Does the driver manager, in order to give you the connection will check if the JDBC Driver is loaded by the System Class Loader? Here is the Description of my Problem: =>I have a Custom class loader =>Using the custom class loader I am loading the Jars associated with the JDBC Driver [Which type doesnt really matter in here] =>Then loading the XXX.XXX.XXX.XXXDriver by invoking loadClass() method on CustomclassLoader =>Passing the Class instance to registerDriver method of DriverManager. But it is raising an exception, and giving an error message as: "No Suitable Driver". Please any body having idea on this, would be appreciated.   More>>

Does the driver manager, in order to give you the connection will check if the JDBC Driver is loaded by the System Class Loader?


Here is the Description of my Problem:


=>I have a Custom class loader


=>Using the custom class loader I am loading the Jars associated with the JDBC Driver [Which type doesnt really matter in here]


=>Then loading the XXX.XXX.XXX.XXXDriver by invoking loadClass() method on CustomclassLoader


=>Passing the Class instance to registerDriver method of DriverManager.

But it is raising an exception, and giving an error message as: "No Suitable Driver".


Please any body having idea on this, would be appreciated.

Thanks in anticipation

Bhakta

   <<Less

Re: :: JDBC Drivers and Class Loader Issue :: ~ Any body help is solicited ~

Posted By:   Anonymous  
Posted On:   Friday, September 30, 2005 10:02 AM

see http://www.kfu.com/~nsayer/Java/dyn-jdbc.html for an example of using a Shim class to wrap the driver, so the driver is visible outside your custom class loader.

Re: :: JDBC Drivers and Class Loader Issue :: ~ Any body help is solicited ~

Posted By:   Christopher_Koenigsberg  
Posted On:   Friday, August 26, 2005 09:50 AM

Let me guess -- maybe your problem is that your DriverManager was loaded by a different ClassLoader, than the ClassLoader which loaded your JDBC Driver Class?
About | Sitemap | Contact