Java执行SQL脚本导入
String cmd = "cmd /c sqlplus usr/pwd@{//服务器IP:1521/}sid @d:\\1.sql>d:\\t.log";Process p = null;
try {
p = Runtime.getRuntime().exec(cmd);
} catch (IOException e) {
e.printStackTrace();
} finally {
if (p != null) {
try {
p.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
}
p.destroy();
}
}
页:
[1]