Hvae a look at example 12-2 on this page:
http://www.commandprompt.com/ppbook/x20856.htm
I found the code quite useful in trying to debug a JDBC driver loading/connectin problem.
Jc