title: Issues with running Runtime.getRuntime().exec
body: <p>I'm using <code>process = Runtime.getRuntime().exec(cmd,null,new File(path));</code>
  to execute  some  SQL in file (abz.sql)</p>
  
  <p>Command is:</p>
  
  <pre><code>"sqlplus "+ context.getDatabaseUser()     +   "/"
            + context.getDatabasePassword() +   "@"
            + context.getDatabaseHost()     +   ":"
            + context.getDatabasePort()     +   "/"
            + context.getSid()              +   " @"
            + "\""
            + script  + "\"";
  
   String path=context.getReleasePath()+ "/Server/DB Scripts";
  </code></pre>
  
  <p>It is executing that file but not getting exit. Hence I tried using: </p>
  
  <pre><code>Writer out = new OutputStreamWriter(process.getOutputStream());
  out.append("commit;\r\n");
  out.append("exit \r\n");
  System.out.println("---------"+out);
  out.close();
  </code></pre>
  
  <p>This it complete block that I m using:</p>
  
  <pre><code>if(context.getConnectionField()=="ORACLE")
  {
  
       String cmd=
      "sqlplus "+ context.getDatabaseUser()     + "/" 
                + context.getDatabasePassword() + "@"
                + context.getDatabaseHost()     + ":"
                + context.getDatabasePort()     + "/"
                + context.getSid()              + " @" 
                + "\""
                + script  +"\"";
  
     String path=context.getReleasePath()+ "/Server/DB Scripts";
     process = Runtime.getRuntime().exec(cmd,null,new File(path));
     out = new OutputStreamWriter(process.getOutputStream());
     out.append("commit;\r\n");
     out.append("exit \r\n");
     System.out.println("---------"+out);
     out.close();    
  
          Integer result1 = null;
      while (result1 == null) {
          try {
              result1 = process.waitFor();
      } 
              catch (InterruptedException e) {}
      }
  
      if(process.exitValue() != 0)
               return false;
         return true;
  }
  </code></pre>