The classpath tells both the java compiler and the VM where to find additional API's/Libraries, whatever you want to call them.
When you put your Connector/J Driver in your classpath, all that did was add another search path so that when the compiler or the VM needs these libraries, it knows where to find them.
What JDBC does is use
Reflection to load the Driver. That basically means that the Connector/J Driver.class file get's loaded and compiled on the fly, or at runtime instead of at compile time. I don't know why they did it this way.
It's just like with the standard API set. Just because they are available via the classpath doesn't mean they are being used.
So as you have probably infered, you not only need the Driver in your classpath so java can find it, but you also need to load it.
In fact, you only need the Connector/J Driver in your classpath when you are
executing the code, not when compiling, because it compiles the driver at runtime. However, I have it in my classpath for both compile and execution. Just in case.
Here is a link to a tutorial I have started on the very basics of JDBC. I basically simplified the very simple
JDBC Tutorial from Sun.
But it hits on a few details that Sun thought most people would infer. I however didn't so I though I would help others like me.
[ December 11, 2002: Message edited by: Gregg Bolinger ]