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"
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
Notice that the //DD:TESTOUT becomes /DD:TESTOUT. Bug with Ant?
I had thought that the zfile would extend the java.io .. possibly get control first. I understand where I started getting confused. I was looking at the FileFactory and read the note about the "//" processing and that it would continue on to other file types if it wasn't a DD or Dataset. I am sure that some wishful thinking on my part was also part of it.
Is there a way to repackage or override the java.io.file to use the com.ibm.jaos classes. It seems like it would make java a whole lot more useful on z/OS.
I am guessing that there isn't an easy way to do it.. otherwise you "dovetail" would have already done it.
This next suggestion is even weirder. Would it be possible to modify the Ant build to replace all occurances of java.io.file with the jzos classes such that it would be a one-to-one replacement? As long as it was something one-to-one, it could be worked into a platform dependent build for Ant to implement the altered classes. Or would be possible to extend the java.io.file to allow for the "//" processing?
After doing some additional reading.. it looks like I might be better off trying to extend existing Ant class(es). I will ask some questions on the ant developer list. Perhaps there are some strategic classes that could be extended to use FileFactory when there is a "//" in the beginning of a filename.