Apache Ant in Batch
Posted: Wed Feb 05, 2014 4:53 pm
I am running Apache Ant on z/OS to perform JDBC connections in batch to DB2 LUW. As part of the Ant buildfile, I am using the Ant Tasks SQL which has an optional parameter of "ouput" which I have used to direct the output to a file. If "output" is not used, any output goes to STDOUT. Should I be able to use something like output="//DD:TESTOUT" instead of the output="/u/user/somefile.txt"
Here is the section from the buildfile.
Here is the verbose message
Notice that the //DD:TESTOUT becomes /DD:TESTOUT. Bug with Ant?
Here is the section from the buildfile.
Code: Select all
<sql
driver="com.ibm.db2.jcc.DB2Driver"
url="jdbc:db2://servername:50000/database"
userid="someuser"
password="password"
print="yes"
failOnConnectionError="true"
output="/u/user/somefile.txt"
onerror="continue">
<transaction src="/u/user/test.sql"/>
<classpath>
<pathelement location="/opt/db2luw/db2jcc4.jar"/>
</classpath>
</sql>
Code: Select all
9.2/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
[echo] Database Connection Test
[sql] connecting to jdbc:db2://servername:50000/database
[sql] Loading com.ibm.db2.jcc.DB2Driver using AntClassLoader with classpath /opt/db2luw/db2jcc4.jar
[sql] Opening PrintStream to output Resource [b]/DD:TESTOUT [/b]
[sql] 0 of 0 SQL statements executed successfully
BUILD SUCCESSFUL