Can anyone suggest a methodology for finding out programatically what
JDBC drivers may be on a machine?
Here's what I intend to attempt:
Get the paths for ext, endorsed, library and classpath
properties/values. For each path found, attempt to load each 'class'
file and then use the driver manager to see if a new driver was
registered or examine the class for 'acceptsURL' or a similar signature
method.
Is there a more straight forward(easier) way?
John Currier - 05 Jun 2005 06:14 GMT
I think you'd want to just see if the class implements java.sql.Driver.
Probably something along the lines of:
Driver.class.isAssignableFrom(potentialDriverClass)
This, of course, assumes that you can successfully load the
potentialDriverClass (all required classes and their requirements are
loadable). Requirements can include things like other classes, dynamic
libraries, configuration files, etc.
John