ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@bost.de>
Subject Re: [PATCH] Print SQL to System.out or output file
Date Wed, 27 Sep 2000 08:58:09 GMT
>>>>> "JMS" == Julian M Savage <jsavage@fisci.com> writes:

 JMS> What's the difference between loadClass() and
 JMS> forceLoadSystemClass()?

Well, forceLoadSystemClass will always try the system class loader
first - you could have achieved the same by setting the third argument
to AntClassLoader's constructor to true.

loadClass will try to load classes from the user classpath first,
unless they live in a package that must be loaded via the system class
loader (by default everything starting with "java.", you can add
different package roots yourself).

I think you've used forceLoadSystemClass to ensure java.sql.Driver
will be loaded by the system class loader - which will be done anyway
(even in JDK 1.1 - I've fixed that with the same commit).

 JMS> My main reason for concern was the thought that instantiating it
 JMS> myself might somehow be less portable or something.

Tested it with FreeTDS, Interbase and DB2 - no problems. The contract
of Driver.connect is quite clear anyway.

We should check for a null return value though - which is supposed to
mean "I'm not the correct driver for the given URL". This is something
DriverManager would transform into a "No suitable driver"
exception. Going to add this.

Stefan

Mime
View raw message