Query regarding the Class.forname method
why can抰 the following code do the job of 搇ocate, load, and link?which Class.forName(Driver name)
is used to perform?
org.gjt.mm.mysql.Driver driver =new org.gjt.mm.mysql.Driver();
This would locate , load and link by executing the static block
Thanks,
[320 byte] By [
Manthan0a] at [2007-11-27 6:33:19]

# 6
Class.forName(org.gjt.mm.mysql.Driver.class.getName());
This requires the class being imported explicitly and available on the classpath during compilation. This isn't the case for the other case.
In both cases though, this class is required in the classpath during runtime.