Capturing Print Statements from Oracle SP in Java

Hi all,
Greetings...
I have one query...pls find below the info for the same:
From my Java application, i am calling Oracle SP using Callable Statement.
Here is the simple Oracle SP..
01. CREATE OR REPLACE PROCEDURE TEST_ORACLE(errcode OUT
02. NUMBER, errdesc OUT CHAR)
03. AS
04. BEGIN
05. dbms_output.put_line('Start of the SP');
06. // SQL Statements will come here
07. dbms_output.put_line('End of the SP');
08. END TEST_ORACLE;
In Line (5) and (7), I have given Print Statements (SOP statements). I need to capture those SOP messages from Java while executing SP / after exceuting it.
In the Java application, i tried the following:
callableStatement.execute();
SQLWarning warnings = callableStmt.getWarnings();
while(warnings != null)
if(warnings.getErrorCode() == 0 && warnings.getSQLState() == null)
System.out.println("Print Statements From SP: "
+ warnings.getMessage() );
warnings = warnings .getNextWarning();
Here warning object is null and i am unable to capture those print statements.
How to capture those print statements from Oracle SP in Java ?
Thanks in advance..
Regards,
Manikandan

Try writing them to a file and read them from your program.
Regards,
Carol.

Similar Messages

  • Retrieval of xmltype data from oracle 10g to java

    Hi
    Right now we are facing an issue on xmltype retrieval from oracle 10g to java.
    I used xmltype column.getClobval() to get the xml content, but unable to do the parse to get the xml data.
    So i tried getStringval(), getting the xml content as string format and here in this case also, i didn't get document object.
    Here is the code snippet:
    String sql = "SELECT node_id,node_desc,parent_node_id,e.report_xml.getStringval() FROM TABLE_STRUCTURE e";
    st = con.createStatement();
    rs = st.executeQuery(sql);
    while (rs.next()) {
    Object value[] = { rs.getString(1), rs.getString(2), rs.getString(3), rs.getString(4) };
    list.add(value);
    DOMParser parser = new DOMParser();
    parser.parse(rs.getString(4));
    doc = (Document) parser.getDocument();
    System.out.println(": DOM = " + doc.getClass().getName());
    Please do guide in this scenario.
    Thanks in advance.
    Sirisha

    Please see below link
    http://www.stanford.edu/dept/itss/docs/oracle/10g/appdev.101/b10790/xdb11jav.htm

  • How can i return object from oracle in my java code using pl/sql procedure?

    How can i return object from oracle in my java code using pl/sql procedure?
    And How can i returned varios rows fron a pl/sql store procedure
    please send me a example....
    Thank you
    null

    yes, i do
    But i can't run this examples...
    my problem is that i want recive a object from a PL/SQL
    //procedure callObject(miObj out MyObject)
    in my java code
    public static EmployeeObj callObject(Connection lv_con,
    String pv_idEmp)
    EmployeeObj ret = new EmployeeObj();
    try
    CallableStatement cstmt =
    lv_con.prepareCall("{call admin.callObject(?)}");
    cstmt.registerOutParameter(1, OracleTypes.STRUCT); // line ocurr wrong
    //registerOutParameter(int parameterIndex, int sqlType,String sql_name)
    cstmt.execute();
    ret = (EmployeeObj) cstmt.getObject(1);
    }//try
    catch (SQLException ex)
    System.out.println("error SQL");
    System.out.println ("\n*** SQLException caught ***\n");
    while (ex != null)
    System.out.println ("SQLState: " + ex.getSQLState ());
    System.out.println ("Message: " + ex.getMessage ());
    System.out.println ("Vendor: " + ex.getErrorCode ());
    ex = ex.getNextException ();
    System.out.println ("");
    catch (java.lang.Exception ex)
    System.out.println("error Lenguaje");
    return ret;
    Do you have any idea?

  • Java not working since upgrade to Firefox 7. My coupon printer states I do not have Java so it will not print. Java states it is incompatable with Firefox 7 = No win situation.

    I print coupons through Smart Source and it worked fine a few months ago. The site states I do not have Java enabled. I go through the Firefox tab to ensure Java IS enabled. The add-ons it states that Java is no longer compatible with Firefox 7 and there are no updates to correct the situation. I have tried ALL the troubleshooting suggestions but NOTHING has worked. I've tried uninstalling/deleting all prior or duplicate versions of Java and reinstalling the latest version but NOTHING has worked.

    Do you see the menu bar or anything else? As for the missing toolbar, this is the case for 90% of Firefox users, for instance the Google Toolbar. To restore it, you need to install Mozilla's Add-On Compatibility Reporter extension from https://addons.mozilla.org/en-US/firefox/addon/15003 and restart Firefox twice.
    As for the white screen, I am not sure what you mean, but your install looks corrupted, you probably need to uninstall Firefox and reinstall from scratch. You may spend too much time and effort otherwise. Back up your settings first if you have any, like Firefox bookmarks.

  • DB Call from Oracle Business Rule +Java Method call from OBR

    Hi,
    1.We have a requirement in project where we need to make DB Call from Business rule.
    We are using ORACLE SOA11g.
    Is this possible.Any pointers on this will be helpfull.
    2.Can we call java method from Oracle Business Rule.If so pls suggest how it can be done.
    Thanks In Advance,
    Oracle SOA User

    You can implement java class to make database updates using JDBC. You can add Java class as fact in business rules and invoke methods as actions of the business rules.
    Hope this will help.
    Jayesh Patel
    http://jayesh-patel.blogspot.com/
    http://www.yagnasys.com/

  • Printing Checks from Oracle r12

    I'm not too sure on where I should have put this post because I really don't know anything about Oracle. In my company I handle Server and PC maintenance mainly. The only thing I do with Oracle is I have to run a report every morning. The people in the positions that would usually handle what I need to get done are extremely busy right now and they have asked me to do research on this issue.
    We are currently in the middle of upgrading to Oracle r12 and running 11i right now. The current check printing we have won't work with r12 from what I hear. Do I have to use a third party program to print the checks from Oracle or is this something we could code ourselves? Sorry if this doesn't make since to anyone, please reply and I will try to explain as well as I can... remember... I only know how to run this one report in Oracle.
    Thanks in advance for any help or advice anyone can give me.

    Hi,
    We are currently in the middle of upgrading to Oracle r12 and running 11i right now. The current check printing we have won't work with r12 from what I hear. Why? What is the reason? Can you print it in Apps11i?
    Do I have to use a third party program to print the checks from Oracle or is this something we could code ourselves? Sorry if this doesn't make since to anyone, please reply and I will try to explain as well as I can... remember... I only know how to run this one report in Oracle. You do not need to use third party software, if you have a printer configured in the application, and you register you custom report (the check report) properly, then you should be able to print from the application.
    You may also review the following documents.
    Note: 312353.1 - Check Printing Using XML Publisher
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=312353.1
    Note: 110406.1 - Check Printing Frequently Asked Questions
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=110406.1
    Note: 459306.1 - XML Checkwriter/Deposit Advice
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=459306.1
    Regards,
    Hussein

  • Very Urgent !! XMLP reports not printing directly from Oracle Apps.

    Hi ,
    We are not able to print XMLP reports directly from Oracle Applications(Concurrent Manager) to the printer.
    We have checked the following setups and they are ok.
    1. Have a Postscript ready printer.
    2. PASTA has been installed and setup.
    3. The printer type "--Pasta Universal Printer Type" is associated with the printer and that the seeded "PDF Publisher" print style and PASTA_PDF printer driver are associated with the printer type. Third party program "pdftops" has been installed in the instance.
    4. pasta_pdf.cfg is present and that it contains an "uncommented" entry as follows:
    preprocess=pdftops {infile} {outfile}
    5. The XMLP Report also has print style as "PDF Publisher".
    Initially, Step 5 was not being followed and the printer was printing the XML data instead of the pdf output.
    Now, after changing it to PDF Publisher, nothing is coming as output to the printer.
    I have checked that both the XML and pdf files are getting generated.
    Does anyone have any idea what could be the problem? Any help is greatly appreciated.
    Regards,
    Satrajit

    Hi Satrajit,
    Please make sure you have pdftops is available on the server and in the PATH.
    Please run following two commands.
    $ which pdftops
    $ which pdf2ps
    Please use one of two commands you found in the server.
    Please review Metalink Note 338990.1 for more details.
    Thanks,
    Shinji

  • Capturing print event from PDF viewer

    Hi all,
    I am using class CL_GUI_PDFVIEWER to display and print a document using a SAP dynpro screen & a custom container.  I am successfully able to do this, but would like to capture the print event from the viewer in some way.  I did not see any print events for this class; is there any way to capture the printing of a PDF document from this viewer?  Thanks much,
    Rebecca Levings

    Hi Rebecca,
    I am using class CL_GUI_PDFVIEWER to display PDF, but also want to print the document.
    If I use PRINT Method of this class I am getting a runtime error. Can you please share your print code .. My requirement is to print a PDF File stored in file Client System without manual intervention.
    Thanks in advance!

  • How to execute this statement from oracle reports

    have to use the following command from oracle reports.
    In oracle forms we can use the HOST command but what about oracle reports2.5.
    I have to email the attached file 100245.pdf from oracle reports to the given email id
    uuencode 100245.pdf 100245.pdf | mailx -s "test" [email protected]

    > u can execute any exe using host that host must contain a bat file
    Incorrect. There is no HOST command in PL/SQL.
    And please note that this is the Database » SQL and PL/SQL forum - and not the Oracle Forms or SQL*Plus forum.
    Also, when using the SQL*Plus HOST command for example, you can execute any executable and not just a BAT file. SQL*Plus on Windows uses the Win32 API call CreateProcess() - and it has no limits as to what/which executable can be executed.

  • Can't get Adobe Reader to print statement from Scottrade on-line

    I have Vista 64 bit Home Premium , Adobe Reader 9, version 9.3. When online with Windows Internet Explorer at www.scottrade .com, I go to my account, account history, account statements and select January 2010 statement to view and a popup screen which should show my statement, but the screen is blank. This screen usually shows the selected statement in PDF and I can print it out. If I wait a minute or so a popup massage comes up that says: Adobe PDF Document. "There is a problem With Adobe Acrobat/Reader. Please exit Adobe Acrobat/Reader and try again."  I exit try again and the same thing happens again. I have uninstalled/reinstalled Adobe Reader, restarted the computer and cannot get it to work.  I did not have this problem several weeks ago.

    I don't have the printing problem but I do have a very similar situation that I believe is a closely tied to your printing problem.  I think the problem is in the way Internet Explorer or Win 7 processes the Adobe button action/script that calls for it to print or save the displayed PDF.
    I have a problem with saving Adobe PDF files from inside Internet Explorer 8.  I'm running Windows 7 Pro, IE 8, Adobe Reader 9.3, and Acrobat 9.3 Pro.  Reader is my IE 8 Add-On.  I can open the PDF file, click on "save a copy" either the icon button or go thru the File menu, but don't ever see the dialogue window that asks where I want to save it to, and of course the PDF file is not saved to my computer.  I click and it just goes null.  I've also tried the CTRL+Shift+S hotkey combo to no avail.
    I once saw a dialogue window that popped up that alluded to "going outside the protected mode to save it" and did I want to continue.  I've only seen that message window once and it was for just a split second.
    I experimented with Protected Mode.  I can open, read, and save the pdf file if I DISABLE Protected Mode.  ENABLING Protected Mode to come back ON resets and reproduces the problem.
    So, thinking it had to do with the Internet Security level, I cranked that setting down to the minimum but kept Protected Mode enabled.  The problem was still there.
    The workaround I use (until someone gives me a better fix) to get the "SAVE a copy to my computer or other location" button of the PDF to actually work is to:
    Double-click Internet|Protected Mode: On at the bottom of the window or tab displaying the PDF file.  This brings up the Internet Security settings panel.
    Uncheck Enable Protected Mode.  You are putting your computer at a bit of a risk... but you aren't going web surfing with Protected Mode turned Off.  Do not leave the site where you turned it off.
    Click Apply and OK.  Close your browser window with the PDF and reopen it to the PDF you need to Save.  If you are on a pop-up window or a second tab, you only have to close that one window or tab and reopen it.
    You may have to log back on if you are working with an online statement of account.
    Your browser should also show that it is "Internet | Protected Mode: Off".  A yellow bar at the top of the page warns you the Protected Mode is turned Off.
    Save the PDF as you've been doing all along until our software (Win 7 Pro U/G with IE8) started belching.
    After saving, repeat steps 1, 2, and 3 above with rechecking Enable Protected Mode, setting it to On.  Clicking the yellow bar at the top of your browser gets you right back into the security settings panel to reset the mode.
    Close your browser and reopen it.  Verify Protected Mode is reset to On.
    It's risky to disable the Protected Mode, but if I need to save a copy of a pdf file, such as a statement of an online account, this is the only way I've discovered how to save a copy of it short of printing a hard copy, then scanning the hard copy to a pdf (a digital file) for storing/disseminating it.  My workaround may also work for your printing needs.  Try it once and don't forget to reset the Protected Mode back to On.
    It's a nuisance, a real pain in the ol' sphincter, to have to do these steps but until Microsoft and Adobe have a meeting of minds and solve the problem... well, I gotta do what I gotta do.
    I've only had Win 7 Pro for about a week. It was working great when I first upgraded from Win XP Pro (clean install) and a day or so ago without any significant changes or alterations on my part it just started acting up.
    I posted this in Microsoft's Win 7 Forum as well so maybe one side or the other will fix it.

  • Calling BIP from Oracle Forms: Having Java version problem.

    <h3>
    Hi,
    I tried to call a BIP report through Oracle Forms.
    I followed this PDF.
    http://www.oracle.com/technology/products/xml-publisher/docs/Forms_BIP_v22.pdf
    Problem is, when I run the form, I get this error (copied from the Java Console)
    Oracle JInitiator: Version 1.3.1.22
    Using JRE version 1.3.1.22-internal Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\channasiriwardena
    Proxy Configuration: Manual Configuration
    Proxy: 192.168.11.100:81
    Proxy Overrides: *.iil.informatics.lk,192.168.11.*,192.168.10.*,<local>
    JAR cache enabled
    Location: C:\Documents and Settings\channasiriwardena\Oracle Jar Cache
    Maximum size: 50 MB
    Compression level: 0 Forms Applet version is : 10.1.2.0
    java.lang.UnsupportedClassVersionError: oracle/j2ee/ws/client/ServiceFactoryImpl (Unsupported major.minor version 49.0)
    I am using Forms Forms [32 Bit] Version 10.1.2.0.2.
    JDeveloper Version is 10.1.3.5.0.
    The Forms 10g Java version is 1.4.
    So according to what I discovered on the net, the problem is: My JInitiator is 1.3 using JRE 1.3, BUT my .JAR file is Java 1.5.
    Since we are using the Oracle JVM, ticking “Use JRE 1.5..” in the Advanced tab of the Internet Explorer Options has no effect.
    We cannot upgrade the Oracle JInitiator to a 1.5 since there is no such JInitiator version. JInitiator is available only up to 1.3.1.30.
    What can I do. What if I install Java 1.3 in my machine and re-compile my JAR file with that? Will that work or is there another solution?
    Has anybody encountered this problem?
    Any help would be greatly appreciated.
    Thanks & Regards,
    C.S.
    </h3>

    Hi,
    Yes, you need to compile your source files with JDK 1.3 (since JInit 1.3.x.x uses JDK 1.3).
    Other solution would be to use JRE 1.5 (instead of JInitiator).
    Check out [this thread|http://forums.oracle.com/forums/thread.jspa?threadID=550563] on how to use JRE1.5
    -Arun

  • Extraction SQL statement from oracle stored procedure stored in file

    Hi,
    I am newbie to oracle stored procedure. I need to extract the list of sqls present in oracle stored procedure. Besides that I also want to parse these sql statements to get the list of tables and columns used. Is there any tool which can help me in doing thats.
    thanks,
    govind

    why don't check on user_dependencies table instead?
    select referenced_name,referenced_type
    from user_dependencies
    where name='<your stored procedure name in upper case>'
    and referenced_type = 'TABLE'HTH,
    Prazy

  • Migrating application from Oracle APEX to JAVA

    We are one of the groups inside oracle. We have an application developed in Oracle APEX. Now we would like to migrate/implement with JAVA. I have idea about APEX development and hosting. Can anyone help me to list out required software/hardware/server/tool/storage to develop as well as host Application by using java.
    Any help is appreciated.
    Thanks.
    Akie.

    This message is from Developer Forum in OTN Oracle.
    ... "There are no plans at Oracle to stop support for Oracle Forms.
    However you should note that support for client-server deployment does have a dead-line (January 05 with extended support until January 08).
    The Web deployment of Forms has no de-support plan for it. We are actually working on the features for the next releases of Oracle Forms right now. "
    As you can see support for Oracle Forms with Clien/Server arquitecture will be finished on January/05 because they are moving to Web Development.
    Additionally they want to mature their JDeveloper until reaches an full integrated tool for Web Development and they are in a good path.
    Thank you my friends

  • From Oracl Developer to Java Please  Guide me

    Hi
    i am presently making Database applications using Oracle Developer as tool. I want to shift to Database solutions using Java as front end. Will it be better to switch on to Java from Developer? I would like to know all pros and cong regarding it
    Thanks
    vikas joshi

    one point: if you use Java, you would develop in standard SQL, because the Java JDBC API is database independend. of course, you could also use the Oracle specific things with the ORACLE JDBC-Driver or just call specific stored procedures via JDBC, but then: what's the benefit in using Java if you code specific ORACLE apps? so, you should change your way of developing database applications from "developing ORACLE apps" to "developing SQL apps" ... just a suggestion.

  • How to print report From Oracle form directly on printer

    Hi,
    I am running report from form and output should be directly printed on printer.
    Database: 11g Release2
    Forms version : 11.1.2
    Report version : 11.1.2
    OS: windows 7 professional 32 Bit
    Written following code:
    declare
    pl_id ParamList;
    varno number;
    x VARCHAR2(150);
    y NUMBER;
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    begin                
    pl_id := Get_Parameter_List('tmpdata');
    IF NOT Id_Null(pl_id) THEN
    Destroy_Parameter_List( pl_id );
    END IF;
    repid := FIND_REPORT_OBJECT('SALEBILLNEW'); -- report object name
    pl_id := Create_Parameter_List('tmpdata');
    Add_Parameter(pl_id,'copies',TEXT_PARAMETER,'1');
    Add_Parameter(pl_id,'background',TEXT_PARAMETER,'Yes');
    Add_Parameter(pl_id,'mode',TEXT_PARAMETER,'Character');
    Add_Parameter(pl_id,'printjob',TEXT_PARAMETER,'YES');
    Add_Parameter(pl_id,'VCOMPANY',TEXT_PARAMETER,:block50.coname);
    Add_Parameter(pl_id,'VCOde',TEXT_PARAMETER,:block50.code);
    Add_Parameter(pl_id,'VOURBILLNO',TEXT_PARAMETER,:BLOCK50.FROMBILL);
    Add_Parameter(pl_id,'PARAMFORM',TEXT_PARAMETER,'NO');
    Add_Parameter(pl_id,'DESTYPE',TEXT_PARAMETER, 'PRINTER') ;
    Add_Parameter(pl_id,'DESNAME',TEXT_PARAMETER, 'OKI MICROLINE 391 TURBO (COPY1) on NILESH-PC') ; --default printer name
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,RUNTIME);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,PRINTER);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rep_adminserver_inorasrv-pc_asinst_3');
    y := LENGTH ('rep_adminserver_inorasrv-pc_asinst_3') + 2;
    x := RUN_REPORT_OBJECT (repid, pl_id);
    WEB.SHOW_DOCUMENT('http://inorasrv-pc:7001/reports/rwservlet/getjobid'||SUBSTR(x,y)||'?server=rep_adminserver_inorasrv-pc_asinst_3&userid=scott/tiger@winorasr');
    Destroy_parameter_list('tmpdata');
    end;
    Above code giving following error:
    REP-52251: The output of job ID 111 requested on Thu Oct 18 18:37:20 IST 2012 cannot be retrieved.<P>REP-51026: No output is generated for job 111.
    Need help..
    Thanks in advance.

    Hi,
    I have change the printer name to OKI
    Add_Parameter(pl_id,'DESNAME',TEXT_PARAMETER, '\\Nilesh-pc\OKI') ;
    Add_Parameter(pl_id,'DESFORMAT',TEXT_PARAMETER, 'dflt.prt');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESNAME,'\\Nilesh-pc\OKI');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'dflt.prt');
    code which i have posted above unable to reach at default printer and gives following error
    The report generated successfully but distribution to destinations failed.
    Modified above code to take default printer from registry.
    Added below code
    rtn_Registry := CLIENT_WIN_API_ENVIRONMENT.Read_Registry('HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows','Device');
    rtn_defaultPrinter := substr(rtn_Registry,1,instr(rtn_Registry,',',1)-1);
    Add_Parameter(pl_id,'DESNAME',TEXT_PARAMETER, 'rtn_defaultPrinter') ;
    It is giving error
    CLIENT_WIN_API_ENVIRONMENT.Read_Registry must be declare.
    Edited by: parapr on Oct 20, 2012 10:47 PM

Maybe you are looking for