How can one load a JDBC driver from a Jar file that is not in the classpath? Currently the Jar's (with the db driver) location is indicated in the run script. However, the application should be deployed as a Jar file, so that the user could start it just by executing that Jar file. The problem is that the user could use any jdbc driver that could be located anywhere on the machine, so I cannot hardcode it, and have to ask the user to provide this information. How can I load the driver after the user has given the Jar location and driver name (it is a Swing application). Right now the driver is loaded and connection established by:
I was trying to use a URLClassLoader, but aparently am missing some step:
Now I just have to look more into the Driver.getPropertyInfo() for more ways to gathering connection information for various kinds of drivers. [ April 12, 2006: Message edited by: Andris Jekabsons ]