Executing sqlldr (sql loader) from java and returning the error code

I'm wandering do sqlldr return any error code whenever it hit error while running in java.
For example, if i run in command prompt using the command below,
C:\ >sqlldr uid/pwd data=abc.dat control=abc.txt
It might give me some indicator that error occurs such as
SQL*Loader-601: For INSERT option, table must be empty. Error on table CURRENCY
or
SQL*Loader-500: Unable to open file (abc.txt)
SQL*Loader-553: file not found
SQL*Loader-509: System error: The system cannot find the file specified.
But when i run in java using the code below,
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("sqlldr uid/pwd data=abc.dat control=abc.txt");
int exitVal = proc.waitFor();
System.out.println("Process exitValue: " + exitVal);
it will only give me the same exitValue of 1(i presume its error) / 0 (i presume no error) instead of the details of the error.
How can i get the exact error code/message if i were to execute it using java?
Any solution?

mg,
I don't think user576271 wants the exit code, I think [s]he wants the error message.
But wouldn't error messages from SQL*Loader be sent to the stderr stream, and not the stdout stream?
In which case user576271 would need method "getErrorStream()" of class java.lang.Process, no?
Good Luck,
Avi.

Similar Messages

  • Calling oracle SQL Loader from java program

    Hi,
    I want to insert data into oracle tables from a text files containing fixed length fields. I am using SQLLoader to achieve this. The requirement is to call the SQLLoader within the java program.
    Does anyone know how to call SQL Loader from java program?
    Thanks,
    Varsha

    Simply "exec" the sqlldr program with the parameters you need to pass to it.
    Runtime.exec (........)
    Try to pass all parameters needed including the username and password, and use the option "silent" to avoid output, and the option "log" to have a log file of the modifications that sqlldr has done to the database.

  • Jasper report on HTML when one image loaded from database and for the other

    How to generate jasper report on HTML when one image loaded from database and for the other we give a image path
    My code
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
              exporter = new JRHtmlExporter();
              exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
              exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos);
              exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, strImageInputDirectory);
         exporter.setParameter(JRHtmlExporterParameter.IMAGES_DIR_NAME, strImageOutputPath == null ? "." : strImageOutputPath);
         exporter.setParameter(JRHtmlExporterParameter.IS_OUTPUT_IMAGES_TO_DIR, Boolean.TRUE);
         exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.FALSE);
         exporter.setParameter(JRHtmlExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
              exporter.exportReport();
              byte[] bdata = ((ByteArrayOutputStream) baos).toByteArray();
    Can any one help pls
    Message was edited by:
    ameet.au

    hey sorry for posting it in this forum.
    but do u have sample code for making it work.. since i am able to do it on PDF format(image from Database and another stored in the webserver) using
    byte image[] =(byte[]) outData.get("image");
                        ByteArrayInputStream img = new ByteArrayInputStream(image);
                        hmimg.put("P_PARAMV3", img);
    print = JasperFillManager.fillReport(reportFileName, hmimg, jrxmlds);
    bdata= JasperExportManager.exportReportToPdf(print);

  • My iCal won't go online and returns the error message: The server responded with "500" to operation CalDAVAccountRefreshQueueableOperation.

    My iCal won't go online and returns the error message: "The server responded with “500” to operation CalDAVAccountRefreshQueueableOperation."

    OK Now I can answer my own question.  The incomprehensible (inexcusably geeky) error message is actually Apple language for saying simply: "The iCloud servers are down again.  Please wait until we've fixed them."  I found this out by talking to Apple support.  It took about 12 hours for the iCloud server synching calendars to come back online.  When they did, my calendar reloaded, and everything was fine.

  • I tried to update my cc and received the error code: A12E1

    I tried to update my cc and received the error code: A12E1

    Hi Samson,
    Welcome to the Community!
    Please perform the below steps:
    1) Reboot the computer.
    2) If error still persist, Rename the OOBE folder to OOBE OLD from
    Mac: MAC HD/Library/Application Support/Adobe
    Windows: C:\Program Files (x86)\Common Files\Adobe and
                    C:\Users\(UserName)\AppData\Local\Adobe
    3) Download Creative cloud once again and try launching.
    4) If you still faces an issue then Quit/End the AAM notifier process
    Windows:
    Press Ctrl Alt Delete
    Start Task Manager
    Click the 'processes' tab and check if you have AAMNotifier running
    If so, click End Task
    Mac:
    Go to Spotlight (magnifying glass at top right on your screen)
    Type Activity Monitor
    Press Return to open Activity Monitor
    Check in the Activity monitor for AAMNotifier
    Quit that process if you find it
    Thanks!
    Ankit

  • I bought the APP Sasol Birds. 146MB of the 147,5MB downloaded without any problem. The download stopped and first the error code 3259 and later the error code 8012 appeared. Can someone help? I want the download to be completed. Thank you. Pieter Strobos

    I bought the APP Sasol Birds. 146MB of the 147,5MB downloaded without any problem. The download stopped and first the error code 3259 and later the error code 8012 appeared. Can someone help? I want the download to be completed. Thank you. Pieter Strobos

    Maybe your firewall or security software are preventing the download from finishing. You could try disabling them until you finish the download

  • When i try to open photoshop this shows up Please uninstall and reinstall the product.  If this problem still occurs, please contact Adobe technical support for help, and mention the error code shown at the bottom of this screen.  Error: 16

    i had to take my photoshop file into a hardrive because my dad was going to give me a new Mac and when things didn't work out and went back to my old one i use the time capsule thing to save everything before but didn't give me photoshop so i physically moved the file and tried to open it but then this error shows up
    Please uninstall and reinstall the product.
    If this problem still occurs, please contact Adobe technical support for help, and mention the error code shown at the bottom of this screen.
    Error: 16
    and when i click the uninstall app on the file it tells me this
    The alias “Uninstall Adobe Photoshop CS6 2” can’t be opened because the original item can’t be found
    and when i click fix alias i click on photoshop and the app just turns into photoshop and i just run in circles
    please help thank you

    Run the cleaner tool and reinstall.
    Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6
    Download CS6 products
    Mylenium

  • Calling SQL LOADER From Java Program

    Hi
    I need to invoke sql loader from inside a Java Class.
    Any Pointers in this regards will be really appreciated.
    Thanks
    Vishal

    You can create two different files which has sqlldr command defined....
    1. loader.sh
    2. loader.bat
    and in the depending on the OS execute one...
             String command = "";
             if(System.getProperty("os.name").equals("Windows 2000")){
                    //if os is windows 2000  then execute bat file
                     command =  <<bat file path>>
              }else{
                      command = <<shell path>>
              Runtime rt = Runtime.getRuntime();
              Process p = rt.exec(command);
              int i = p.exitValue();
             

  • HT1414 my iphone 4 running on IOS 5 will not come out of recovery mode and gives the error code -1. Can any one help me please because i've been without a phone for 2 weeks and still not getting anywhere.

    Hi there could someone out there please help i've got a Iphone 4 running on IOS 5 and it will not come out of recovery mode> It comes up with the error code -1 which i've looked everywhere on the web but no one seams to have the same issue.
    This is a reconditioned replacement phone from the apple genius guys which i paid £130 for and only got 3 months warranty with and as soon as the warranty run out it crashed on me and never been able to get it back out of recovery mode. I've been back to the apple genius guys and they have told me there's nothing they can do other than charge me £130 to take the phone off me and give me another reconditioned phone with a 3 month warranty. Which as you can properly tell i dont want to.
    PLEASE PLEASE HELP ME thanks for your time

    This is a bad hardware error, Baseband Error. Some have reported getting through this error by Restoring iPhone with the SIM Card removed. Try that. Try restoring with different computer. Search Web some more for other thoughts.

  • Loading huge file with Sql-Loader from Java

    Hi,
    I have a csv file with aprox. 3 and a half million records.
    I load this data with sqlldr from within java like this:
               String command = "sqlldr userid=" + user + "/" + pass
                        + "@" + service + " control='" + ctlFile + "'";
                System.out.println(command);
                if (System.getProperty("os.name").contains("Windows")) {
                    p = Runtime.getRuntime().exec("cmd /C " + command);
                } else {
                    p = Runtime.getRuntime().exec("sh -c " + command);
                }it does what I want to, load the data to a certain table, BUT it takes too much time, Is there a faster way to load data to an oracle db from within java?
    Thanks, any advice is very welcome

    Have your DBA work on this issue - they can monitor and check performance of SQL*Loader
    SQL*Loader performance tips          [Document 28631.1]
    SQL*LOADER SLOW PERFORMANCE          [Document 1026145.6]
    Master Note for SQL*Loader          [Document 1264730.1]
    HTH
    Srini

  • How to Call SQL Loader from Java ( servlet )?

    We need to call SQL Loader command from Java Servlets? Any suggestions how this can be done?
    Thanks
    Rahul

    Probably not the best way, but you could try using JNI to call a C function which then invokes SQL Loader via system() or exec(). I haven't done this myself though...

  • Run Clear Case command from java and save the out put in to a file.

    Can any one help me out ...
    I want to execute Clear case command from a java and want to save the out put of this command to a file.
    I am naot able to find out how to start..
    Message was edited by:
    chandra_verma

    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Recently upgraded to windows XP from NT and get the error "can not load control"

    I am using a LabVIEW VI to run two Opteon digital cameras. Originally, they were run off a Windows NT machine, however it ran out of hard drive space and we had to upgrade to a Windows XP machine. I installed all the new drivers from Opteon, however when I run the VI on the new system it does not load the image viewer or scroll bars and I recieve the error "could not load control". The control for the view screen is "MVCamView" and the control for the scrollbars is "MSForms.IScrollbar". The drivers sent to me by Opteon work fine, as the free program that Opteon sent has no problems.

    Hi, Tsumma33
    Thank you for the question.  Try uninstalling all components of iTunes in the order specified of the article below.  Once this is done attempt to install iTunes again.
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    http://support.apple.com/kb/ht1923
    You may need to process the steps in the article below for each component when uninstalling iTunes if the issue persists.
    "The feature you are trying to use is on a network resource that is unavailable" alert when removing Apple software in Windows
    http://support.apple.com/kb/TS3704
    Cheers,
    Jason H.

  • How do I get the screensavers to stop loading from iphoto and remove the ones now in screensaver?

    How do I remove photos from screensaver and get them to stop importing from wherever in my computer they are importing from?

    Apple Menu / System Preferences / Desktop & Screen Saver. Select Screen Saver and click on what you want. There probably is a "slide show" selected.
    You can turn it off by setting Start After: Never.

  • When connecting to Google, Firefox says it's not trusted and returns the error "sec_error_unknown_issuer"

    I'm running the latest version of Firefox on Windows 7 Home Premium. I use Kaspersky antivirus.

    Kaspersky has a feature to scan your web traffic and when it wants to scan HTTPS connections it needs to intercept and decrypt the traffic, which requires presenting Firefox with a fake certificate.
    This support article has the steps for setting up Opera by importing a certificate file generated by Kaspersky, and it's most similar for Firefox:
    http://support.kaspersky.com/us/9093#block1
    In Firefox, you would import the .cer file using the Advanced Panel of the Options dialog, here:
    "3-bar" menu button (or Tools menu) > Options > Advanced > Certificates mini-tab > "View Certificates" button
    When the Certificate Manager dialog opens, click the Authorities tab (as you would in Opera).
    Can you get the certificate imported and get to Google?

Maybe you are looking for