Here is what Im trying to do:

I created an app that creates special queries. How can I have my java app automatically send those created queries directly to a terminal window? or it can directly connect to the ftp server and send the query and return output. Is this possible?