java调用oracle工具,比如imp,exp,sqlloader等的方法:
示例:imp调用
public String importDmpFile(String cmd) {
Process proc = null;
String errorInfo = null;
try {
proc = Runtime.getRuntime().exec(cmd);
InputStream istr = proc.getErrorStream();
BufferedReader br = new BufferedReader(new InputStreamReader(istr));
String str;
while ((str = br.readLine()) != null) {
errorInfo += str + "\n";
}
proc.waitFor();
} catch (Exception e) {
Console.debug(e);
}
proc.destroy();
return errorInfo;
}
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16179598/viewspace-544546/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/16179598/viewspace-544546/