ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Wolfgang Hujer <>
Subject Re: Driver Attribute of SQL Task should not be required
Date Fri, 31 May 2002 18:57:01 GMT
Am Freitag, 31. Mai 2002 19:51 schrieb Steve Loughran:
> ----- Original Message -----
> From: "Christian Wolfgang Hujer" <>
> To: <>
> Sent: Friday, May 31, 2002 9:25 AM
> Subject: Driver Attribute of SQL Task should not be required
> > Hello dear ANT users,
> >
> > I think the driver attribute of the SQL task should be optional, not
> required.
> > It is possible to load a JDBC Driver using the -Djdbc.drivers property,
> e.g. using ANT_OPTS="" in ~/.antrc.
> > And I think the driver is generally more system dependent than build
> dependent.  So the driver should be set as an attribute to the SQL task if
> it is build dependent, as global Java property otherwise.
> we are trying to move away from all the magic properties, so no, I think it
> should stay as an attribute. Also, in my experience, the driver is often
> application dependent, so that I have different drivers for each app and
> the db they talk to.
I do not request to remove the attribute, the attribute must stay.  But
I request to change the attribute's state from "required" to "optional".

> The best practise would be to always use a property to set the driver, so
> it can be overridden

Best practise is always a personal opinion.  Of course things would be very
easy if everyone shared everyone's opinion on what's best practice.

I do not consider it best practice to always use a property to set the
driver because I think it is easier to always set ANT_OPTS to include
"-Djdbc.drivers=..." to set the drivers generally in use in the local
environment and only use a different driver if a different driver, usually
not used driver is used by the SQL task.

I have ANT_OPTS include JAVA_OPTS. Some scripts also use JAVA_OPTS to
autoload the JDBC Drivers.  So if the driver changes, I do not need to
change several scripts and files for all different projects, I only need to
change JAVA_OPTS.

I think best practice is always what is easiest to change, is most stable
and is not much work to do.  This differs from environment to environment.

What do others think about this?

By the way the change to do is very easy.
Line 368 of file JDBCTask just has to be changed from "throw new
BuildException..." to "return;"

Christian Wolfgang Hujer
Geschäftsführender Gesellschafter
Telefon: +49 (089) 27 37 04 37
Telefax: +49 (089) 27 37 04 39

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message