using RMAN commands in Java
I tried to launch thow Runtime processor RMAN commands, but after execution "RMAN" next commands cannot be executed, here is my code, what is the problem?
ArrayList<String> cmd=new ArrayList<String>();
cmd.add("rman");
cmd.add("connect target/");
cmd.add("exit");
for (int i=0;i<cmd.size();i++){
Process proc=rt.getRuntime().exec(cmd.get(i).toString());
BufferedReader br=new BufferedReader(new InputStreamReader(proc.getInputStream()));
String line=br.readLine();
while(line!=null)
{
line=br.readLine();
System.out.println(line);
}