ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nagarajan Murugesan <>
Subject problem in executing sql statements under foreach task
Date Wed, 13 Aug 2003 05:41:51 GMT
Hai Friends,
I need a help from you all.
I have two questions.

1. I am trying to execute set of sql files present in a directory one by one
using foreach task. my test code is like this. How can I pass
(properties)variables defined in the other targets.
i.e ${driver}, ${durl}.... or is there any way to acheieve that?

<taskdef name="interactive"
<target name="getuserinput">
<interactive verbose="off">
<input property ="driver" text="Database Driver" type="string"
<input property="durl" text="Driver URL" type="string"
<input property="dbuname" text="User Name" type="string" value="cdm"/>
<input property="dbupass" text="PassWord" type="string" value="cdm"/>

<taskdef resource="net/sf/antcontrib/" />
<target name="test">
   <foreach param="myparam" target="sqlrun">
         <fileset dir="D:\orac" includes="*.sql"/>
<target name="sqlrun">
	<echo>Called with ${myparam}</echo>
	<sql onerror="continue" driver="${driver}" url="${durl}"
userid="${dbuname}" password="${dbupass}" >
  	<transaction  src="${myparam}"/>

The echo command gives correct result, but when its trying to execute sql
file it throws
Class Not Found: JDBC driver ${driver} could not be loaded error. ( I am
sure, I have added neccessary jar files in the
class path)

2. My second question is can we control the order of execution, i.e by
alphatical or parent directoty 
first then sub directoy and so any attributes for that is available?

Thanks & Regards,
Nagarajan M.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message