fileWriter = new FileWriter(rootPath + File.separator + "sqlldr" + "\\sqlldr.txt");
fileWriter.write("userid=irmsp/jrirmsp@ora920");
fileWriter.write(10);
fileWriter.write("csqlldr\\sqlldr.ctl");
fileWriter.write(10);
fileWriter.write("log = " + task.getIrms().getInstallPath() + File.separator + "sqlldr\\logon.log");
fileWriter.write(10);
fileWriter.write("bad = " + task.getIrms().getInstallPath() + File.separator + "sqlldr\\logon.bad");
fileWriter.write(10);
fileWriter.write("errors=30");
fileWriter.write(10);
fileWriter.write("direct=true");
fileWriter.write(10);
fileWriter.close();
stmt.execute("truncate table UNITDICTIONARY_"+period+major_id+"_TEMP");
String cmdStr = "cmd.exe /c start " + task.getIrms().getInstallPath() + "\\sqlldr\\sqlldr.bat";
Process process = Runtime.getRuntime().exec(cmdStr);
System.out.println("Runtime.getRuntime()=" + Runtime.getRuntime() +" startTime=" + startTime);
process.waitFor();
cstat = conn.prepareCall("{call sp_load_data(?,?,?)}");
//
cstat.setInt(1, period);
cstat.setString(1, period);
cstat.setString(2, major_id);
cstat.setString(3, rep_date);
cstat.executeUpdate();
();
cstat.close();
cstat = null;
代码只是一部分(全部太多)
但是别的只是fileWriter.write的重复写东西
应该不影响大家对程序的理解
[[italic] 本帖最后由 北极光 于 2007-12-4 11:05 编辑 [/italic]]