db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert J. Carr" <rjc...@gmail.com>
Subject Re: using derby with ant's sql task
Date Tue, 20 May 2008 00:14:57 GMT
Thaks for the suggestion Rick.  I was mostly writing as a sanity check
as it seems there must be a better / different way.  I'm not sure how
much better a custom task is compared to a bit of embedded groovy, but
thanks for the suggestion (and sanity check!).

On Mon, May 19, 2008 at 2:08 PM, Rick Hillegas <Richard.Hillegas@sun.com> wrote:
> Hi Robert,
> You might be able to get what you want by writing a custom ant Task, i.e., a
> class which extends org.apache.tools.ant.Task. If you need some examples of
> how to do this, you can grep the Derby source tree for "PropertySetter" or
> "MessageBuilder".
> Hope this is useful,
> -Rick
> Robert J. Carr wrote:
>> I'm using an embedded derby database in my application.  There is an
>> initialization that requires some table updates and I'd like to have
>> these done in ant using the <sql> task.
>> The problem I'm having is setting the 'derby.system.home' system
>> property.  Unlike the <java> task, the <sql> task doesn't take the
>> nested <sysproperty> property.
>> I'm sure it could be done with environment variables but I'd like to
>> avoid doing this if possible.
>> Are there any solutions others have used?  I'm not aware of a way to
>> have ant set a system property outside of the <java> task.
>> The kludge I've come up with is, since I was already using groovy for
>> something else, I embedded a line of groovy to set
>> 'derby.system.home'.  Thankfully the <sql> task isn't forked so the
>> property persists.  But I do feel this is a kludge and would like to
>> know a better way, if possible.
>> Thanks!

View raw message