sqlloader6

try
            {
                // 获得执行结果.判断,如果为2,表示执行成功
                exitValue = ldr.waitFor();
                if (exitValue == 2 || exitValue == 0)
                {
                    if (logger.isDebugEnabled())
                    {
                        logger.debug("ORACLE SQLLoad success.");
                    }
                    result = true;
                }
                else
                {
                    logger.error("ORACLE SQLLoad failed," + this);
                }
            }
            catch (InterruptedException e)
            {
                logger.error("ORACLE SQLLoad interrupted.", e);
            }
            finally
            {
                boolean delResult = new File(cmdarray[CMD_CTLFILEPATHNAME_IDX])
                        .delete();
                if (delResult)
                {
                    if (logger.isDebugEnabled())
                    {
                        logger.debug("ORACLE SQLLoad delete ctl file "
                                + cmdarray[CMD_CTLFILEPATHNAME_IDX]
                                + " success.");
                    }
                }
                else
                {
                    logger.error("ORACLE SQLLoad delete ctl file "
                            + cmdarray[CMD_CTLFILEPATHNAME_IDX] + " failure.");
                }
            }

        }
        catch (IOException e)
        {
            logger.error(e.getMessage(), e);
        }
        return result;
    }

猜你喜欢

转载自sunxuecheng.iteye.com/blog/1178951
6