毒药魔流 2019-11-09 16:38 采纳率: 0%
浏览 567

java执行EXP导出Oracle数据库并没有导出的文件生成

java执行EXP导出Oracle数据库并没有导出的文件生成

在网上搜了很多方法都没有解决

    public static boolean EXP() {
            Runtime rt = Runtime.getRuntime();
            try {
                Process p = rt.exec("cmd.exe EXP u/p@db..com:1521/ORCL FILE =D:\\ORACLE\\daochu.dmp tables=(AS_14)");
                InputStream inputStream = p.getInputStream();
                InputStream errorStream = p.getErrorStream();
                writeToLocal("D:\\ORACLE\\zhengque.txt", inputStream);
                inputStream.close();
                writeToLocal("D:\\ORACLE\\cuowu.txt", errorStream);
                errorStream.close();

            } catch (IOException e) {
                e.printStackTrace();
            }
            return false;
        }

        private static void writeToLocal(String destination, InputStream input)
                throws IOException {
            int index;
            byte[] bytes = new byte[1024];
            FileOutputStream downloadFile = new FileOutputStream(destination);
            while ((index = input.read(bytes)) != -1) {
                downloadFile.write(bytes, 0, index);
                downloadFile.flush();
            }
            downloadFile.close();
            input.close();
            return;
        }
  • 写回答

1条回答 默认 最新

  • 关注
    评论

报告相同问题?

悬赏问题

  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作