现在的位置: 首页 > 综合 > 正文

java通过cmd命令调用sqlplus执行sql脚本

2013年05月30日 ⁄ 综合 ⁄ 共 195字 ⁄ 字号 评论关闭

 

String cmd="sqlplus username/password@sid @c:/test.sql > c:/test.log";  

   

  try   {  

  Process pr = Runtime.getRuntime().exec(cmd);

  pr.waitfor();
  }   catch   (IOException   e)   {  

  e.printStackTrace();  

  }  

抱歉!评论已关闭.