View pdf file stored in oracle database through oracle forms

Forms [32 Bit] Version 10.1.2.0.2 (Production)
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
Oracle Toolkit Version 10.1.2.0.2 (Production)
PL/SQL Version 10.1.0.4.2 (Production)
Oracle Procedure Builder V10.1.2.0.2 - Production
PL/SQL Editor (c) WinMain Software (www.winmain.com), v1.0 (Production)
Oracle Query Builder 10.1.2.0.2 - Production
Oracle Virtual Graphics System Version 10.1.2.0.2 (Production)
Oracle Tools GUI Utilities Version 10.1.2.0.2 (Production)
Oracle Multimedia Version 10.1.2.0.2 (Production)
Oracle Tools Integration Version 10.1.2.0.2 (Production)
Oracle Tools Common Area Version 10.1.2.0.2
Oracle CORE     10.1.0.4.0     Production
I have created external directory and am able to load pdf files in oracle database table called test_blob.
CREATE TABLE test_blob (
id NUMBER(15)
, file_name VARCHAR2(1000)
, image BLOB
, timestamp DATE
I have 2 pdf files in the table. I want to view this pdf from forms when the user clicks on the button. On when-button-pressed trigger I want to show pdf on the screen. Any help is appreciated. Not on the designer. I want to run form application.
SELECT id, file_name,
DBMS_LOB.GETLENGTH(image) Length,
timestamp
FROM test_blob
ID|FILE_NAME|LENGTH|TIMESTAMP
1001|2011 HeartlandEmployeeReferralCard.pdf|353718|1/28/2013 11:44:41 AM
1002|2011 HeartlandEmployeeReferralCard.pdf|353718|1/28/2013 11:51:07 AM
Edited by: user_anumoses on Jan 28, 2013 11:45 AM

We were able to do the same thing with Oracle Application Server and Oracle WebLogic Server. I cannot remember how different the processes were, but it seems like they were very similar. I am going to give you the instructions on how we implemented a "Read PDF" procedure on the WebLogic Server. If you are still on the Application Server you may have to do some Google searches, but it all boils down to the mod_plsql DAD Configuration file.
Our PDF was located in a table with the following structure:
CASE_DOCUMENTS
   (id_document                    NUMBER NOT NULL,
    doc_blob                       BLOB,
    note                           VARCHAR2(240),
    created_by                     VARCHAR2(20) NOT NULL,
    created_dt                     DATE NOT NULL,
    case_id                        NUMBER NOT NULL,
    filename                       VARCHAR2(100) NOT NULL)Based on that table structure we created a procedure named READ_PDF which you will reference below in the dads.conf file below:
CREATE or REPLACE procedure read_pdf (p_id_document IN number)
is
  view_file     blob;
BEGIN
  select doc_blob
    into view_file
    from case_documents
   where id_document = p_id_document;
  OWA_UTIL.MIME_HEADER ('APPLICATION/PDF', FALSE);
  HTP.P ('CONTENT-LENGTH: ' || DBMS_LOB.GETLENGTH (view_file));
  OWA_UTIL.http_header_close;
  WPG_DOCLOAD.download_file (view_file);
END;
GRANT EXECUTE ON read_pdf TO financial_user_role  -- Name of role to execute
/Basically, you are passing in one parameter and that is the primary key for your table. You are selecting the pdf stored in a BLOB for that primary key. The commands below that allow the pdf to open up so you can view it – we got this off some search we did a few years ago.
Now, you need to add logic to your Oracle Form that will call the procedure above, but the URL is based on the dads.conf file that we will set up below… Anyway, we created a button on the form module with a label of "View". In the WHEN-BUTTON-PRESSED trigger the logic looks like this:
-- The View logic uses the DAD (Database Access Descriptors) method to view a .pdf file from the form.
-- The DAD was created on WebLogic Server  with the name findadgen.  This allows an http request be made
-- to the database.
declare
  v_file          varchar2(400);
  v_success       boolean;
  ret_val         number;
  v_http_link     varchar2(400);
begin
  -- The format of the link is as follows: hostname:port/pls/DAD_name/procedure_name
  v_http_link := 'http://finas03:8888/pls/findadgen/read_pdf?p_id_document=' || :case_documents.id_document;
  web.show_document(v_http_link, '_BLANK');
end;The name of our WebLogic Server is "finas03" so that is what is listed in the URL. The "findadgen" is the name of the <Location> in the dads.conf file below, the "read_pdf" is the name of the procedure we created above, the "p_id_document=" is the IN parameter listed in the READ_PDF procedure created above, and the ":case_documents.id_document" is the reference to the primary key in our Oracle Form.
For WebLogic, you can either go through Enterprise Manager (directions below) or update the dads.conf file on the filesystem directly (if you update the dads.conf file directly then skip to step 4 and ignore step 5):
1.     Enterprise Manager -> Web Tier -> ohs1
2.     Oracle HTTP Server (pull-down) – Administration – Advance Configuration
3.     Select File – dads.conf
4.     Add something similar:
# ============================================================================ 
#                     mod_plsql DAD Configuration File                         
# ============================================================================ 
# 1. Please refer to dads.README for a description of this file                
# ============================================================================  
# Note: This file should typically be included in your plsql.conf file with 
# the "include" directive. 
# Hint: You can look at some sample DADs in the dads.README file 
# ============================================================================
<Location /pls/findadgen>
    SetHandler pls_handler
    Order allow,deny
    Allow from All
    AllowOverride None
    PlsqlDatabaseUsername financial
    PlsqlDatabasePassword sdo_3#d1
    PlsqlDatabaseConnectString ffindbTNSFormat
    PlsqlNLSLanguage AMERICAN_AMERICA.WE8ISO8859P1
    PlsqlAuthenticationMode Basic
    PlsqlDefaultPage read_pdf
</Location>You are adding the <Location> section to your dads.conf file. The "finddadgen" is the name that you will reference in a change you fill make to your Oracle Form. The "financial" is the Schema, the "sdo_3#d1" is the password for that Schema, the "ffindb" is the database that the stored procedure is located on, and the "read_pdf" is a stored procedure you will have to create in order to read the pdf.
5.     Press the "Apply" Button
6.     Obfuscate the DAD password by running the dadTool.pl script located in $ORACLE_HOME/bin (This was done on Unix on our server with the following commands):
$> LD_LIBRARY_PATH=$ORACLE_HOME/lib;export LD_LIBRARY_PATH
$> cd $ORACLE_HOME/bin
$> perl dadTool.pl -f /u01/app/oracle/middleware/asinst_1/config/OHS/ohs1/mod_plsql/dads.conf
7.     Restart the Oracle HTTP Server using Fusion Middleware Control:
Enterprise Manager -> Web Tier -> ohs1
Oracle HTTP Server – Control – Shutdown
Oracle HTTP Server – Control – Start Up
If you followed the instructions above, you should have created a stored procedure, added logic to your Oracle form to reference that stored procedure, and created an entry in the dads.conf file. Once you move the form onto the server and you restart the HTTP Service, you should be able to view a pdf that is stored in a table directly from your Oracle Form.

Similar Messages

  • Java App connection to an Oracle Database through Oracle Stored Procedure

    My team's access to its Databases (Oracle only) is restricted to access through Oracle Stored Procedures that are part of the Oracle Database. So, in my Java App I need to call the Stored Procedure that will give me the access to the table that I need, declare the right parameters and execute the command. The Stored Procedure will then hand me the data I need.
    I am finding support on the web for creating Stored Procedures in Java, but that is not what I need.
    Can anyone post here a class that addresses this, or point me to a link that will shed some light on it?
    Thanks
    user606303

    user606303 wrote:
    Sorry this code is unformatted - I can't see how to format it.Use \ tags
    I am looking for Java code that will do what this .NET code below does (connects to a database and writes data to the table through an Oracle stored procedure that is part of the Oracle Database.)
    So learn Java, learn JDBC and translate the requirements; don't attempt to translate the code as the platforms are too different.
    From a quick glance it looks like a JDBC CallableStatement can do the job.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Best ways to view/display PDF/Excel files stored in the Database

    What are best ways to display/view PDF/Excel files stored in the Database? thanks L

    Thanks tom, sorry let me explain. Currently we have oracle forms screen, using webutil to store/view files into DB. client won't like the interface, they want us to make it more friendly, drag and drop if possible, load multiple files, as possible.. So I am exploring different ways to improve may be java (or jdev/any any other), different screen designs, different features for fileupload/download/view options.

  • Oracle reports to display PDF/Excel files stored in the Database

    can we use Oracle reports to view/display PDF/Excel files stored in the Database? Thanks Lalitha

    A document stored in the database can be easily retrieved in or via the browser using mod_plsql. Simplified:
    select content, mime_type
    into v_blob, v_mime_type
    from ...
    owa_util.mime_header(nvl(v_mimetype,'application/octet'),false);
    htp.p('Content-length: ' || dbms_lob.getlength(v_blob));
    owa_util.http_header_close;
    wpg_docload.download_file(v_blob);So, the link in your report should point to this database procedure.
    Edited by: InoL on Mar 1, 2011 4:17 PM

  • Displaying PDF files (stored as BLOBs in Database) using Forms 6i

    Hi,
    We have PDF and Word documents stored in Database (Version 8.1.7). We are using Oracle Forms 6i as User Interface. Through Forms we could view word documents which are stored in database, using OLE container.
    But we could not view PDF files.
    It would be more helpful and valuable if I get ideas/suggestions on this.
    Thanks in advance,
    Umasankar

    Frank,
    You are correct, I totally agree with you.
    TOAD software which i suggested was not for user interface but more for testing purpose - To ensure that the documents is uploaded to BLOBS correctly.
    I am not a WEB person, but I believe sugnificant coding is required in forms6i/9i with WEB features to display the respective documents.
    If, the purpose in ONLY for testing, then TOAD can be used which requires no coding.
    -- Shailender Mehta --

  • How can I read content from PDF file stored in Oracle 9i XMLDB

    Hi Friends:
    Now I have met one question that I don`t know how to read some String , for example "Hello", from the PDF file stored in the Oracle 9i XMLDB, I have stored that PDF file into the XMLDB now, any suggestions are appriciated . Thank you in advance.

    You may be able to do something with Oracle Text. The following shows how to get an HTML rendiditon of a binary document. I think you can also get plain text instead of HTML
    set echo on
    spool xfilesUtilties.log
    connect sys/&1 as sysdba
    grant ctxapp to &2
    connect &2/&3
    begin
      ctxsys.ctx_ddl.create_policy(policy_name=>'XFILES_HTML_GENERATION', filter=>'ctxsys.auto_filter');
    end;
    create or replace package xfiles_internal_11010
    authid definer
    as
      function renderAsHTML(sourceDoc BLOB) return CLOB;
    end;
    show errors
    create or replace package body xfiles_internal_11010
    as
    function renderAsHTML(sourceDoc BLOB)
    return CLOB
    as
      html_content CLOB;
    begin
      dbms_lob.createTemporary(html_content,true,DBMS_LOB.SESSION);
      ctx_doc.policy_filter(policy_name => 'XFILES_HTML_GENERATION',
                            document => sourceDoc,
                            restab => html_content,
                            plaintext => false);
      return html_content;
    end;
    end;
    show errors
    create or replace package xfiles_utilities_11010
    authid current_user
    as
      HOME_FOLDER   constant varchar2(700) := xdb_constants.HOME_FOLDER;
      PUBLIC_FOLDER constant varchar2(700) := xdb_constants.PUBLIC_FOLDER;
      function renderAsHTML(sourceFile VARCHAR2) return CLOB;
      function transformToHTML(xmldoc XMLType, xslPath VARCHAR2) return CLOB;
    end;
    show errors
    create or replace package body xfiles_utilities_11010
    as
    function renderAsHTML(sourceFile VARCHAR2)
    return CLOB
    as
    begin
      return xfiles_internal_11010.renderAsHTML(xdburitype(sourceFile).getBLOB());
    end;
    function transformToHTML(xmldoc XMLType, xslPath VARCHAR2)
    return CLOB
    as
      html clob;
    begin
      select xmldoc.transform(xdburitype(xslPath).getXML()).getClobVal()
        into HTML
        from dual;
      return html;
    end;
    end;
    show errors
    grant execute on xfiles_utilities_11010 to public
    create or replace public synonym xfiles_utilities for xfiles_utilities_11010
    quitMessage was edited by:
    mdrake

  • Pdf file stored as BLOB data type on Oracle

    I store PDF file as BLOB data type on Oracle. There are cases
    where I get multiple records from the database, that means I get
    multiple PDF files. They have to be merged and displayed on the web
    page. I tried CFContent which can display only one PDF file at a
    time but not more than one, whereas cfdocument is having problem
    converting binary data to string. I am kind of stuck.
    Can you anybody please help me out? Please let me know if you
    have any questions or this does not make sense to you.
    Thank you in advance.

    BALAJI_JAY wrote:
    > Can you anybody please help me out? Please let me know
    if you have any
    > questions or this does not make sense to you.
    if by "merge" you mean 3 pdf into 1 pdf, try cfpdf (if on
    cf8) or see this
    thread if cf version less than 8:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&threadid=11 14635&messageid=4032202

  • How to view PDF files strored in a BLOB column

    Hi all,
    I want to display a PDF file, stored in a BLOB column, in a form or through a JavaBean.
    But the problem is more complicated then that. I do not want to retrieve the PDF file in the application server that show it through a browser.
    Actually, I do not want users to get the entire file, I just want them to see it or print it.
    I want, in fact, to display a "stream" of bytes through Oracle Forms. Not a file.
    This one, sounded to be a good solution, but actually not. When the file was too big (multiple pages), the application was blocked until the entire file was loaded. And when you try to print it, it wasn't printed right. The advantage of this solution is that it is open-source so we can add methods to connect to the DB, retrieve the content of the BLOB column and displays it without downloading the file.
    Here is a good solution. Really good, files are loaded quickly, the rendering is really good and the file is printed perfectly (as it was printed from Adobe Acrobat). The disadvantage of this solution is that it is not open-source and is really expansive.
    As you can see, both solutions uses PJC.
    So any help, any idea to solve my problem will be highly appreciated.
    Thanks to all of you,
    Amine
    PS : I am using F&R 11gR2

    Not entirely. At least we came to the conclusion it doesn't make (much) sense to block the save option of PDFs if you want to allow printing them
    Anyway; there is of course another possibilty: you could always write your own java bean PDF reader; there are plenty of java PDF libraries available:
    Open Source PDF Libraries in Java
    The easiest way would be to choose one which can open a PDF from a URL and render it; I would retrieve the image via mod_plsql using WPG_DOCLOAD and simply use the PDF library to render the PDF. No tempfiles anyway, and if you don't implement it there is also no save button.
    cheers

  • Jsp page opening pdf file stored in an ORDDOC type column

    Dear All,
    i am building a jsp page that opens a pdf file stored in database. if column type is BLOB, i run the prepareStatement and store in a ResultSet, and then BufferedInputStream(result.getBinaryStream("FILE")). it works. page opens the pdf file.
    but when column type is ORDDOC, i get this error:
    Failure in java.sql.SQLException: Ongeldig kolomtype.: getBinaryStream not implemented for class oracle.jdbc.driver.T4CNamedTypeAccessor
    what more do i do to get a pdf(or txt, msword..) file to jsp page and open it?
    regards
    Jerry

    We are facing this problem with IE6 browser only. In firefox, it opens fine in a browser window. What configuration should we do in IE6?
    Thanks,
    Ananth.

  • Can't save pdf files downloaded from some databases

    When I download some pdf files from databases (e.g. SpringerLink) I can download to READ only (there is NO toolbar for printing/saving/etc). I am accessing them through a University library which gives access. Is there some setting I need to change? OR are some files restricted to read only??? If so - how can I tell that is the case before I download?

    Graffiti - I did have Adobe Reader 9 - and I use Google Chrome.
    Inspired by your questions, I downloaded Adobe Reader X 10 - the pdf files still don't go through the 'normal' process of requesting to be saved and being open. They appear immediately but with no toolbar.
    SO I tried right clicking on the pdf file which could just be viewed, saving it, and THEN - YES THAT starts the 'normal' process of appearing as a file with the possibility of opening it (with toolbar).
    Is this 'normal'? I've opened large numbers of pdf files - and I never remember having to right click in order to start the process.
      Thanks very much for all your help,
      Drwhoish

  • Chrome - Adobe-Acrobat/Reader can not be used to view PDF files in a web browser.

    I can't view PDF files via Chrome (it works on Internet Explorer but I prefer Chrome)  -  the error below has arisen recently on Chrome, though I can't see what has changed.
    "Acrobat plug-in
    The Adobe-Acrobat/Reader that is running can not be used to view PDF files in a web browser. Please exit  Adobe Acrobat/Reader and exit your Web Browser and try again."
    I have looked through Forum articles on similar errors and have tried the following(text copied from other Forum entries)
    Repair Adobe Acrobat (from Acrobat)
    Repair Adobe Acrobat (from Control Panel
    Configure Acrobat  as a helper application: Choose Edit > Preferences., Select Internet on the left., Deselect Display PDF In Browser Using [Acrobat application], and then click OK.Quit Acrobat or Reader
    Create a registry item for Acrobat: with Regedit: If the registry item doesn't exist on the system, do the following: Go to Edit > New > Key and create the missing HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe.Go to Edit > New > String Value and name this key (Default).Select (Default), and then go to Edit > Modify. Type the Adobe Acrobat path in the "Value data" for your product.,restart your computer
    Repair the HKCR\AcroExch.Document registry key: Navigate to HKEY_CLASSES_ROOT\AcroExch.Document., Right-click AcroExch.Document and select Delete; make sure that you have the correct key, and click Yes on any prompts, Right-click AcroExch.Document.7 and select Delete; make sure that you have the correct key, and click Yes on any prompts. Repair your Acrobat  installation
    None has solved the problem. However it still works ok with IE. But I want to stick with Chrome because I find IE is so slow!
    I am using Vista, with Adobe Acrobat standard 9.5.2 and Google Chrome version 23.0.1271.64 m which is marked on Chrome as 'up to date'
    Does anyone know why I might be getting this error on Chrome but not IE?

    I think I have discovered the answer to my own question!
    I have disabled Adobe Reader plug-in, and can now see PDFs in Chrome.
    (Steps: Chrome Menu, Settings option, Click Advanced Settings link, then Content Settings button, then select Disable Individual Plug-Ins, and a list of plug-ins is offered to enable or disable).
    I then get a different result depending on whether or not Chrome PDF viewer is enabled - with it enabled I see the PDF document in Chrome, or with it disabled then the option is offered to download it, but either way I can get it it via Chrome without having to run Internet explorer in another browser window.

  • How can i display a pdf file stored in my KM from webdynpro link ?

    Hi experts,
    i try to open my pdf file stored in km, in the same window of my webdynpro java who has the fire link ?
    i user tow  iviews with inBound and outBound plug, the first one has the fire link and the seconde an iframe witch i set source parameter to my km link where my PDF is stored. Unfortunately, the iFrame don't work correctly, and my PDF is not be displayed
    Can you give some advices ?

    Hi
    Recently in my project I came across a scenario where my Web Dynpro Project had to pick the image from KM. The images to be displayed will be placed in KM. This will avoid loading the images into the Web DynPro project. More over when you have KM installed on your EP server, one can use it for storing backend data and resources. The KM Admin will be undertaking this task of uploading the images to predefined folder structures. Through the application path to the image will be provided dynamically giving you the flexibility to decide which image to be displayed according to the business logic.
    Getting an image from KM Documents to be used in Web Dynpro
    Uploading files to KM repository using Webdynpro APIs
    KM with WebDynpro
    thanks
    Suresh

  • Can't view PDF files in Wb Browser

    Hello from a relative newbie to Adobe.
    Recently I began getting the message " Adobe Acrobat Reader that is running cannot be used to view PDF files in a web browser. Adobe Acrobat/Reader version 8 or 9 is required. Please exit and try again " when viewing web sites.
    I have Adobe Acrobat 4 ( and always have, I think ) so I successfully downloaded Version 9.1 but still keep getting the same message.
    Could I get some help please ?
    Cheers,
    George Krooglik
    Albury, Australia
    29th September, 2009

    As long as I can view the current bank files (not downloads), the actual statements are not vital.  I can print those pages, but it's just very difficult and time consuming to go through all of that when a statement is what I need.  I can always go back to paper statements in the mail, but those would just be current.
    Anyway, it happened just as you said...out of the blue.  You probably know more than I do about computer issues...you might check out your firewall and security settings.  I get lost when I start checking things out, so I'll try to keep track and let you know if I find a solution.
    Thanks, George...maybe Adobe will respond???
    Take care.....
    "Sometimes I wonder whether the world is being run by smart people who are putting us on...or by imbeciles who really mean it"                    Mark Twain

  • Viewing pdf files on memory card

    Hi
    I need to be able to save a pdf to memory card and then view it, this will be on devices that are below version 7. Currently as I understand, it is possible to do this on bb's with version 7 or above through doc's to go premium edition.
    Obviously I could goto appworld and download to device, however this will not work in the corporate environment (credit cards etc) and there are about 50 devices.
    Does anyone know of a company that I could purchase a license from so I can push from BES or any other ideas how I can best do this?
    Thanks
    Mike
    Solved!
    Go to Solution.

    To view PDF files saved to the media card or device memory on devices of OS6 or lower, you can use PDFtoGO premium, contact Dataviz.com
    or Repligo or BeamReader ot purchase their product.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How to create an Oracle DATABASE through Java Programming Language.. ?

    How to create an Oracle DATABASE through Java Programming Language.. ?

    Oracle database administrators tend to be control freaks, especially in financial institutions where security is paramount.
    In general, they will supply you with a database, but require you to supply all the DDL scripts to create tables, indexes, views etc.
    So a certain amount of manual installation will always be required.
    Typically you would supply the SQL scripts, and a detailled installation document too.
    regards,
    Owen

Maybe you are looking for

  • Please help - entire library is missing

    Hello guys, I am currently experiencing some problems with iTunes, I hope someone can help me. After not having used my PC since September, I accessed it yesterday. After installing the iTunes update, everything was still normal, but after the comput

  • How to put the message in sxi_monitor when call a bapi

    hi experts, I call a bapi in my abap program, and I want to put some information of this program into the xml messages,then I can monitor in future, but I don't know how to do this. Thanks.

  • Update Named query in EJB

    Hi Experts, I have created an EJB DC to interact with CE database using JPA's and named query. My read query is working fine and i can see the output in WS Navigator. For "Update" i have written a named query like : @NamedQuery(name = "updatePos", qu

  • EWA Report do not generate ..

    Hi , The early Watch Report is not generated. I have checked every thing , rfc are working fine and services are activated also. Created a new Refresh Session using Sdccn In my satellite system. BUT i can not see the job SM:EXEC SERVICES executing in

  • Is oracle net services included in XE?

    Greetings from a newbie, Is net services included in XE? If not, is this a stand alone piece? regards, Valerie