Specifies a file to which the system should direct output for a session. Specify the file name relative to the current directory, or specify the absolute path.
ij.outfile=fileName
java -Dij.outfile=out.txt org.apache.derby.tools.ij myscript.sql