I want to send ftp or telnet commands on the Unix command box. I want to connect to say ftp enter user name and password and then run "ls" command

Here is what I have written so far, code to ftp.
But when I run the program I do not know what has happened? How can I do the next stage like enter "user name" "password" and finally run "ls" command for unix?????????
import java.lang.*;
import java.io.*;

public class RuntimeFTP{

public static void main(String[] arg){
Runtime rt = Runtime.getRuntime();
String[] callAndArgs = { "ftp.exe", "jaguar.wmin.ac.uk" };

try
{
Process child = rt.exec(callAndArgs);
child.waitFor();
System.out.println("Process exit code is: " + child.exitValue() );
}
catch(IOException e)
{
System.err.println("IOException starting process!");
}
catch(InterruptedException e)
{
System.out.println("Interrupted waiting for process!");
}
}
}