Forums Register Login

how to get Driver location from datasource at runtime?

+Pie Number of slices to send: Send
Hi, I want to find the location from where a driver class is loaded. Assuming I only have the datasource, and the driver class name.

Is that posible? have you any idea about how to get that?

Thank You

I'm running in jboss
+Pie Number of slices to send: Send
Cesar,
Welcome to JavaRanch!

It can be done by getting the classpath, looping through it and listing the classes in each jar. However, it is suspect. What are you trying to accomplish with the driver location? Why can't you just pass it in?
+Pie Number of slices to send: Send
Thanks Jeanne,

Well I know the path of the class beforehand, I just having an issue with the driver and wanted to make sure the driver is taken from supposed and not from other place maybe. For example in jboss you can put driver 1 in %JBOSS_HOME%/server/default/lib, but if the .ear has its own driver 2, then I want to know what driver is being loaded by classloader.

That's why I was trying to determine how to find what driver is being loaded, at run time.

BTW, is this topic in the correct saloon?, should this be moved to JDBC or JBOSS saloons?

-Cesar Flores
Alas, poor Yorick, he knew this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1074 times.
Similar Threads
DB2
Driver or datasource
Tomcat DataSource
Tomcat's Datasource
Class.forName()
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 06:35:23.