Store pdf in oracle  BLOB  hibernate

I need to store PDF files in the oracle BLOB using hibernate. I am using the below code and getting a null pointer. Any thoughts?
Blob blob=null;
byte [] bFile = (byte[])objVal;
blob.setBytes(0,bFile); //null pointer here...
logger.info("EventsDAO- insertDetails- else:--"+((byte[])objVal)+"---blob----"+blob);
hmForm.put(objKey,blob); Thanks in advance.

Samples? Are you asking how to make a blob? I have my doubts about the wisdom of using Hibernate if you can't diagnose a NPE unless that was just momentary code snow-blindness, but whatever, it's your problem:
Either call Hibernate.createBlob(InputStream,long) or just map the field as a byte[] and map it to a Blob type.
Edited by: dcminter on 09-Jun-2008 22:22

Similar Messages

  • Error while trying to store PDF in Oracle's BLOB field

    Hi folks!
    I'm having problems while trying to store PDF file in a BLOB field of an Oracle table
    This is the message code:
    Exception in thread "main" java.sql.SQLException: Data size bigger than max size for this type: 169894
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:95)
    at oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2414)
    at oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1134)
    at oracle.jdbc.driver.OraclePreparedStatement.setBytes(OraclePreparedStatement.java:2170)
    at vgoactualizacion.Main.main(Main.java:84)     
    This is the piece of code i'm using:
    Assuming conn = conection to Oracle 10g Database ( it's working )
    String miProcedimientoAlmacenado = "{ call package_name.update_client(?,?, ?) }";
    CallableStatement miComando = conn.prepareCall(miProcedimientoAlmacenado);
    miComando.setString(1,miClienteID ); //first parameter : IN
                   //second parameter : IN
    File miPDF = new File(pathPDF + "//" + miClienteID + ".pdf");
    byte[] bodyIn = readFully(miPDF); //readFully procedure is shown below
    miComando.setBytes(2, bodyIn); //THIS IS THE LINE WHERE THE ERROR IS PRODUCED
              //3rd parameter: OUT
    miComando.registerOutParameter(3, java.sql.Types.VARCHAR);
    miComando.execute();
    private static byte[] readFully(File miPDF) throws FileNotFoundException, IOException {
    FileInputStream fis = new FileInputStream(miPDF);
    byte[] tmp = new byte[1024];
    byte[] data = null;
    int sz, len = 0;
    while ((sz = fis.read(tmp)) != -1) {
    if (data == null) {
    len = sz;
    data = tmp;
    } else {
    byte[] narr;
    int nlen;
    nlen = len + sz;
    narr = new byte[nlen];
    System.arraycopy(data, 0, narr, 0, len);
    System.arraycopy(tmp, 0, narr, len, sz);
    data = narr;
    len = nlen;
    if (len != data.length) {
    byte[] narr = new byte[len];
    System.arraycopy(data, 0, narr, 0, len);
    data = narr;
    return data;
    }//fin readFully
    This approach indicates that the PDF file is converted into an array of bytes, then is stored as binary in the BLOB field.
    Thanx in advance, and looking forward for your comments.

    You will probably need to use the setBinaryStream() method instead of setBytes().

  • How to store PDF file in BLOB column without using indirect datastore

    Hi ,
    I want to store a pdf file in a BLOB column.
    But , it should be a direct store. I cannot usre indirect datastore.
    BLOB column doesn't support indirect datastore. I get the following error.
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-10581: indirect datastores cannot be used with long or lob text columns
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 365
    can anyone give me any clue onhow to manage this issue?

    Thanks This really helped.
    For other readers, I am summarising what I did.
    create table test
    id number primary key,
    docs BLOB
    create or replace directory doc_loc
    as 'c:\test';
    CREATE OR REPLACE PROCEDURE Load_BLOB_From_File (file_name in varchar2)
    AS
    src_loc bfile:= bfilename('DOC_LOC',Load_BLOB_From_File.file_name);
    dest_loc BLOB;
    begin
    insert into tkctsf15t values(1,empty_blob()) returning docs
    into dest_loc;
    dbms_lob.open(src_loc,DBMS_LOB.LOB_READONLY);
    DBMS_LOB.OPEN(dest_loc, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.LOADFROMFILE(
    dest_lob => dest_loc
    ,src_lob => src_loc
    ,amount => DBMS_LOB.getLength(src_loc));
    DBMS_LOB.CLOSE(dest_loc);
    DBMS_LOB.CLOSE(src_loc);
    COMMIT;
    end;
    show errors;
    exec Load_BLOB_From_File('test.pdf');
    exec ctx_ddl.create_preference('mylex','BASIC_LEXER');
    create index testx on test(docs) indextype is ctxsys.context
    parameters
    ('filter ctxsys.AUTO_FILTER LEXER mylex ');
    select id from test where contains(docs,'patch')>0;
    Thanks Roger once more

  • How to store pdf into blob, index it and search it?

    I am trying to store pdf into a column, index the column and search it.
    I store pdf file into blob column with either the following code or with an interface in apex
    declare
    Dest_loc BLOB;
    Src_loc BFILE := BFILENAME('DIR_TESTCASE', 'intermedia.pdf');
    BEGIN
    INSERT INTO pdffiles(id, description)
    VALUES(1, 'InterMedia Concepts')
    RETURN text INTO Dest_loc;
    DBMS_LOB.FILEOPEN(Src_loc, DBMS_LOB.LOB_READONLY);
    DBMS_LOB.LOADFROMFILE(Dest_loc, Src_loc, dbms_lob.getlength(Src_loc));
    DBMS_LOB.FILECLOSE(Src_loc);
    COMMIT;
    END;
    then i need to create an index
    begin
    ctx_ddl.create_preference('pdf
    lexer', 'BASICLEXER');
    ctx_ddl.set_attribute('pdf_lexer', 'printjoins', '_-');
    end;
    create index PDFFILES_TEXT on PDFFILES(TEXT) indextype is ctxsys.context
    parameters ('lexer pdf_lexer');
    sqlplus says index created but windows gives an error and closes ctxhx.exe
    and of cource when I tried to make a search like
    select id, description
    from pdffiles
    where contains(text,'Oracle') > 0;
    it doesn't return any results.
    My database is 10g XE, I also tried it on Oracle 10.2.0.3 EE

    It is possible to store pdf and doc files in a blob column, create a text index, and search them, and display them. However, you cannot expect to just select doc and pdf data directly from a blob column and expect to be able to read it, due to all of the special formatting characters. You need to use ctx_doc.snippet or ctx_doc.markup or some such thing to format it and make it readable. Please see the demonstration below. You can search the online documentation for complete syntax, additional information, and examples.
    SCOTT@orcl_11g> CREATE TABLE my_files
      2    (id   NUMBER,
      3       doc  BLOB)
      4  /
    Table created.
    SCOTT@orcl_11g> CREATE OR REPLACE DIRECTORY DIR_TESTCASE AS 'c:\oracle11g'
      2  /
    Directory created.
    SCOTT@orcl_11g> declare
      2    Dest_loc BLOB;
      3    Src_loc     BFILE;
      4  BEGIN
      5    INSERT INTO my_files (id, doc) VALUES (1, EMPTY_BLOB())
      6    RETURNING doc INTO Dest_loc;
      7    Src_loc := BFILENAME ('DIR_TESTCASE', 'banana.pdf');
      8    DBMS_LOB.FILEOPEN (Src_loc, DBMS_LOB.LOB_READONLY);
      9    DBMS_LOB.LOADFROMFILE (Dest_loc, Src_loc, dbms_lob.getlength (Src_loc));
    10    DBMS_LOB.FILECLOSE (Src_loc);
    11    INSERT INTO my_files (id, doc) VALUES (2, EMPTY_BLOB())
    12    RETURNING doc INTO Dest_loc;
    13    Src_loc := BFILENAME ('DIR_TESTCASE', 'test1.doc');
    14    DBMS_LOB.FILEOPEN (Src_loc, DBMS_LOB.LOB_READONLY);
    15    DBMS_LOB.LOADFROMFILE (Dest_loc, Src_loc, dbms_lob.getlength (Src_loc));
    16    DBMS_LOB.FILECLOSE (Src_loc);
    17  END;
    18  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> INSERT INTO my_files (id, doc)
      2  VALUES (3, UTL_RAW.CAST_TO_RAW ('blob data for id 3'))
      3  /
    1 row created.
    SCOTT@orcl_11g> COMMIT
      2  /
    Commit complete.
    SCOTT@orcl_11g> SELECT id, DBMS_LOB.GETLENGTH (doc) FROM my_files
      2  /
            ID DBMS_LOB.GETLENGTH(DOC)
             1                  222824
             2                   19968
             3                      18
    SCOTT@orcl_11g> CREATE INDEX my_files_idx ON my_files(doc)
      2       INDEXTYPE IS CTXSYS.CONTEXT
      3  /
    Index created.
    SCOTT@orcl_11g> SELECT COUNT (*) FROM dr$my_files_idx$i
      2  /
      COUNT(*)
           308
    SCOTT@orcl_11g> COLUMN first_45 FORMAT A45
    SCOTT@orcl_11g> SELECT id,
      2           UTL_RAW.CAST_TO_VARCHAR2 (DBMS_LOB.SUBSTR (doc, 18, 1)) AS first_45
      3  FROM   my_files
      4  /
            ID FIRST_45
             1 %PDF-1.5
    %âãÏÓ
               1
             2 ÐÏࡱá
             3 blob data for id 3
    SCOTT@orcl_11g> EXEC CTX_DOC.SET_KEY_TYPE ('ROWID')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> COLUMN keywords_in_context FORMAT A45 WORD_WRAPPED
    SCOTT@orcl_11g> SELECT id,
      2           CTX_DOC.SNIPPET
      3             ('MY_FILES_IDX',
      4              ROWID,
      5              'contents OR (fruit of the month) OR data',
      6              '<<',
      7              '>>')
      8             AS keywords_in_context
      9  FROM   my_files
    10  WHERE  CONTAINS (doc, 'contents OR (fruit of the month) OR data') > 0
    11  /
            ID KEYWORDS_IN_CONTEXT
             1 <<Fruit of the Month>>
               Banana
               Bananas are the most popular
             2 This is the original <<contents>> of
               test1.doc.
             3 blob <<data>> for id 3
    SCOTT@orcl_11g>

  • How To Store pdf or doc file in Oracle Database using Java Jdbc?

    can any one help me out How To Store pdf or doc file in Oracle Database using Java Jdbc in JSP/Serlet? i tried like anything. using blob also i tried. but i am able 2 store images in DB not files. please if u know or else if u have some code like this plz send that to me, and help me out plz. i need that urgent.

    Hi.. i am not getting error, But i am not getting the original contents from my file. i am getting all ASCII vales, instead of my original data. here i am including my code.
    for Adding PDF in DB i used image.jsp
    Database table structure (table name. pictures )
    Name Null? Type
    ID NOT NULL NUMBER(11)
    IMAGE BLOB
    <%@ page language="java" import="java.util.*,java.sql.*,java.io.*" pageEncoding="ISO-8859-1"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%
    try{
         Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
         PreparedStatement ps,pstmt,psmnt;
         ps = con.prepareStatement("INSERT INTO pictures VALUES(?,?)");
    File file =
    new File("D:/info.pdf");
    FileInputStream fs = new FileInputStream(file);
    ps.setInt(1,4);
    ps.setBinaryStream(2,fs,fs.available());
    int i = ps.executeUpdate();
    if(i!=0){
    out.println("<h2>PDF inserted successfully");
    else{
    out.println("<h2>Problem in image insertion");
    catch(Exception e){
    out.println("<h2>Failed Due To "+e);
    %>
    O/P: PDF inserted successfully
    i tried to display that pdf using servlet. i am giving the code below.
    import java.io.IOException;
    import java.sql.*;
    import java.io.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class DispPDF extends HttpServlet {
         * The doGet method of the servlet. <br>
         * This method is called when a form has its tag value method equals to get.
         * @param request the request send by the client to the server
         * @param response the response send by the server to the client
         * @throws ServletException if an error occurred
         * @throws IOException if an error occurred
         public void service(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              //response.setContentType("text/html"); i commented. coz we cant use response two times.
              //PrintWriter out = response.getWriter();
              try{
                   InputStream sPdf;
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                        Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
                        PreparedStatement ps,pstmt,psmnt;
                   psmnt = con.prepareStatement("SELECT image FROM pictures WHERE id = ?");
                        psmnt.setString(1, "4"); // here integer number '4' is image id from the table.
                   ResultSet rs = psmnt.executeQuery();
                        if(rs.next()) {
                   byte[] bytearray = new byte[1048576];
                        //out.println(bytearray);
                        int size=0;
                        sPdf = rs.getBinaryStream(1);
                        response.reset();
                        response.setContentType("application/pdf");
                        while((size=sPdf.read(bytearray))!= -1 ){
                        //out.println(size);
                        response.getOutputStream().write(bytearray,0,size);
                   catch(Exception e){
                   System.out.println("Failed Due To "+e);
                        //out.println("<h2>Failed Due To "+e);
              //out.close();
    OP
    PDF-1.4 %âãÏÓ 2 0 obj <>stream xœ+är á26S°00SIá2PÐ5´1ôÝ BÒ¸4Ü2‹ŠKüsSŠSŠS4C²€ê P”kø$V㙂GÒU×713CkW )(Ü endstream endobj 4 0 obj <>>>/MediaBox[0 0 595 842]>> endobj 1 0 obj <> endobj 3 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj xref 0 7 0000000000 65535 f 0000000325 00000 n 0000000015 00000 n 0000000413 00000 n 0000000168 00000 n 0000000464 00000 n 0000000509 00000 n trailer <<01b2fa8b70ac262bfa939cc786f8770c>]/Root 5 0 R/Size 7/Info 6 0 R>> startxref 641 %%EOF
    plz help me out.

  • Any good way to store pdf files in oracle 10g?

    have, i have many pdf files, i want to store in database. Any good way to do that in 10g? Or, I have to go to 11?
    thanks,
    t.k.

    mbobak wrote:
    Justin Cave wrote:
    user10217806 wrote:
    Can I store pdf in blob, and still search words in the pdfs?Probably not, no. If you want to search the data inside Oracle, you'll want to look at Oracle Multimedia.I think the correct answer is "not efficiently". :-)Well, there is nothing that prevents you from building Oracle Multimedia yourself and getting similar levels of efficiency. Other than a desire not to invest dozens of man-years replicating delivered functionality, of course.

  • How to store a PDF in a BLOB column, then select/search it using SQL?

    We have a simple requirement.
    (1.) We have an Oracle 10g DB.
    (2.) We want to store PDFs/MS Word docs inside BLOB column in a table.
    (3.) We need to show PDF/MS Word content to the user, without opening the PDFs/MS World like we normally do (i.e. Using PDV reader/ MS Word).
    (4.) i.e. We need to use SQL statements and
          (a.) Get all contents of the PDF/MS WORD doc.
          (b.) Search for specific strings inside these docs in the BLOB columns.How to do this pls? Code sample would be really great.
    Edited by: user12240205 on Jul 18, 2012 9:35 PM
    Edited by: user12240205 on Jul 18, 2012 9:37 PM

    rp0428 wrote:
    >
    We have a simple requirement.
    >
    Really? You mean as opposed to a requirement that might actually be doable?Could be that simple is used as in stupid ? Like in, "+look at this simply idiotic requirement, blah.. blah...+"? ;-)
    @user12240205:
    BLOBs contains binary data. Not text data. How do you propose to search binary data for strings?
    PDF and Word formats include actual text strings and identifiers as part of the formatting. How do you propose that this be identified and ignored when searching for specific strings in the document's content?
    PL/SQL does not have the ability to take a page from a PDF/Word document, highlight the search string, and display that to the client. A format-parser is needed to parse the PDF/Word format and generate that as content (e.g. HTML or XML) that can be rendered by a client. How do you propose PL/SQL serves up search strings that it found, when it cannot interpret the document format? (cannot even say what page, section or paragraph, that search string occurs)
    Documents can be loaded via the DBMS_LOB interface. Either from the db server's file system, or by the client supplying the document as chunks for "write appending" to a BLOB. See Oracle® Database PL/SQL Packages and Types Reference guide for details.
    Text search and document indexing are supported by an Oracle feature called Content Management<a> (which includes interMedia, UltraSearch, Oracle Text, etc).
    Oracle also supports (on Window server platforms), the Microsoft Component Object Model (COM). COM interfaces (such as COM for Word) can be used for specialised processing (e.g. searching Word documents). Oracle's COM feature allows one to interface directly with external s/w (e.g. MS Word) via its COM interface.

  • Storing PDF as a BLOB on Oracle 9i

    Hello,
    I need to store a PDF document in ORACLE. I obvioulsy need to store it as a BLOB. I have created a BLOB filled in the table but I have no idea what to do next. Are there any good tutorials on this ? Can someone provide me a very simple code that inserts BLOB and than reads it?
    Thanks

    Dear All,
    try this code it will store image or any file or pdf in to oracle database but,
    the only thing you do is to put the table column type as 'LONG RAW'
    It stores all the above as BLOBs.
    try
    // create connection
    PreparedStatement pstmt = null;
    File f = new File(file_path);
         FileInputStream fis = new FileInputStream(f);
         // System.out.println("IMG : "+file_name+" Len : "+f.length());
         String insert = "insert into table_name values(?)";
         pstmt = con.prepareStatement(insert);
         pstmt.setBinaryStream(1,fis,(int)f.length());
         i = pstmt.executeUpdate();
         fis.close();
         f = null;
              catch(Exception e)
                   e.printStackTrace();
              finally
                   try{
                        if(pstmt!=null)
                             pstmt.close();
                        if(con!=null)
                             con.close();
                   catch(Exception e){}
              }

  • Need guidence to store scan pdf in oracle 10g

    Hello guru
    I have 20000000 (2 corer) A4 size scan pdf containing text and images having
    Average size 0f 0.5 mb. please guide me how can i store it in oracle database and what i have to do for same.
    I am using oracle 10g forms as a front end for inserting & retriving scan pdf from database.
    Regards
    Vishal

    Vishal,
    Here are 2 options , first you can use either procedure or anonymous block to load clob data
    First Method -- I loaded alert.log successfully and you can imagine how big this file can be (5MB in my test case), in your case you need to specify your pdf file. CLOB/BLOB can take upto 4GB data
    Make sure you have privs to create , read or write to directory
    create table t1clob (
    clob_data clob  -- you can use blob
    CREATE OR REPLACE DIRECTORY DIR AS '/my_path_to_pdf_file/pdf';
    DECLARE
       clob_data   CLOB;
       clob_file   BFILE;
    BEGIN
       INSERT INTO t1clob
       VALUES (EMPTY_CLOB ())
       RETURNING clob_text INTO clob_data;
       clob_file   := BFILENAME ('DIR', 'wwalert_dss.log');
       DBMS_LOB.fileopen (clob_file);
       DBMS_LOB.loadfromfile (clob_data,
                              clob_file,
                              DBMS_LOB.getlength (clob_file)
       DBMS_LOB.fileclose (clob_file);
       COMMIT;
    END;
    Second Method: Use of Sqlldr
    Example of controlfile
    LOAD DATA
    INFILE alert.log "STR '|\n'"
    REPLACE INTO  table t1clob
       clob_text char(30000000)
    )Also check this link for more example
    http://www.oracle-base.com/articles/10g/LoadLobDataUsingSqlLoader.php
    Hope this helps.
    Regards
    Edited by: OrionNet on Feb 6, 2009 11:59 PM

  • PDF binary variable won't save in Oracle blob

    I am reading in a small, legitimate PDF as a binary variable and them immediately saving that variable into a blob. But the blob doesn't store the data.
    <cffile action="readbinary" file="C:\Test_Files\test.pdf" variable="testdoc">
    now shows isbinary(testdoc) = YES
    In fact, I can output to the screen using cfcontent, and it displays fine.
    But if I try to save the testdoc variable to an Oracle blob, CF seems to think it is trying to insert an empty variable.
    <cfquery name="ins" datasource="#request.a_datasource#">
    INSERT
    INTO PROD_WCT.T_DOCS (
    PDF_BLOB
    VALUES (
    <cfqueryparam value="#testdoc#" cfsqltype="CF_SQL_BLOB">
    Now if I retrieve that row (query name=”get_pdf”) and check the value, it appears empty:
    now shows isbinary(get_pdf.pdf_blob) = NO
    Nothing is done in betweent the cffile and the insert. Any ideas?

    Just an update here to note that this problem has not yet been resolved.
    This could be in incompatibility between Oracle 10g BLOBs and Coldfusion 8.
    To review, my BLOB setting in CFADMIN is enabled. To make this as simple and possible, I created a PDF from the words "Test text," so the PDF document can't get much smaller. The PDF does save to the BLOB, because in TOAD I can save the BLOB contents to a file and view it as a PDF just fine. It's when I retrieve the record in CF8 where the trouble arises. Coldfusion 8 doesn't get anything from the BLOB. It has a zero length, and isbinary = NO. We are using Oracle 10g. And using CF8. My understanding is that an Oracle blob uses pointers to locate the blob data in an area external to the database. Apparently, Coldfusion cannot retrieve the data. The process worked for the first few records when retrieving a blob and displaying it with cfcontent, but after a few records it can no longer retrieve the subsequent blob records. It just abruptly fails at that point. But again, the PDF binary data is there in TOAD.
    Could this be a bug or incompatibility with Oracle 10g? We are a state government, and it sure would help if the Adobe people could give come help here.
    Thanks in advance for any thoughts.

  • Store PDF File in Oracle database 10g

    Hi all,
    I want to store PDF File in Oracle database 10g,
    and then I want to access the pdf file using Oracle Developer 6i
    can anyone tell me how to do this,
    thanks in advance.

    This question has already been posted a lot of times.....
    See the following:
    http://forums.oracle.com/forums/search.jspa?threadID=&q=pdf+file&objID=f82&dateRange=lastyear&userID=&numResults=15
    Greetings,
    Sim

  • To store PDF into BLOB and retrieve into OLE/OCX

    We would like to:
    1. Store a PDF file (output of a report saved in file server) into a BLOB
    column.
    2. Retrieve previously stored PDF in the BLOB column and display using either
    OLE automation or ActiveX (OCX) control.
    I read all related documents in metalink that addresses this issue however cant
    get this to work. We have Acrobat Reader 4.0. Here are some issues from the
    tests that I did:
    1. To load the PDF file the program code that uses BFILE and LOADFROMFILE does
    not work since the database is on a remote server and the PDF file is on a
    local file server. The DIRECTORY created on the database is unable to find the
    PDF file.
    2. Though I want the loading of the file to be programmatic, I tried
    right-click on the OLE container and inserted object from file. This loaded the
    file into the container (Icon on the container appeared) however I was not able
    to view the document by double-clicking. An error in Adobe occured: 'There was
    an error opening this document. A file read error occured'. My guess is the
    'Insert Object' did not insert the file properly into the BLOB.
    3. When trying to display the PDF file stored in file server (in case storing
    into BLOB does not work), I used an OCX control, right-clicked and Insert
    Object and select Adobe Control for ActiveX. The problem here is when I run the
    form, the OCX control shows up empty and I have to 'Insert Object' again in
    runtime. Once I manually insert object from runtime the GET_INTERFACE POINTER &
    SET_PROPERTY works fine is displaying the document. Is there any way to
    maintain the control property of the OCX when the form is run?
    4. Are there any workarounds and better solution to store PDFs into BLOBs and
    retrieve and display in OLE/OCX controls? Using temporary file into local drive
    is not an issue.
    5. Would I be able to make use of 'PDF.PdfCtrl.1' OLE class?
    6. Does OLE automation work for Acrobat Reader 4.0.?
    I would appreciate all the help.
    Shyam

    Im facing a similar kind of problem. I want to store and retrieve Office files, PDF and Jpegs into/from the database to view them on web in disconnected mode. Please reply as I cant find any help/documentation regarding saving BLOB data into files. I was able to store file data into BLOB, using DBMS_LOB package.
    Shahzad

  • To upload a PDF file in BLOB column using Oracle Forms 9i

    Can anyone tell me how to upload a PDF file from client system using File dialog window and store its content in BLOB column in a table. The file to be uploaded will be in client side.

    Take a look at the following :
    Re: Storing a PDF in a BLOB
    Re: Retrive Image from DB into Image_item
    although the threads above are reffered to images and word doc... the procedure/steps are the same....
    Greetings...
    Sim

  • How to store file content in BLOB field MySql database using java

    Hi!
    i want to store the file content in a BLOB field in MySql database using java.
    Please help me out..........
    thanx in advance...
    bye

    i stored images in db, and retrieved them. like that cant i store pdf file in db, and retrieve it back using oracle db?
    Plz help me out how to put a file in db. i need complete code. thanks in advance.

  • Downloading a PDF document via blob won't open start acrobat on click

    I'm experiencing a problem trying to get acrobat reader to open immediately when viewing a file stored as a blob is clicked. I am updating an old plsql webtoolkit app that stores pdf files in the database as a blob and displays them to the user in a frame. Download is achieved using wpg_docload.download_file() and the example provided by Oracle documentation. The download package body is:
    BEGIN
      l_filename := SUBSTR(OWA_UTIL.get_cgi_env('PATH_INFO'), 2);
    -- get mime type from db
      SELECT blob_content,
             mime_type
      INTO   l_blob_content,
             l_mime_type
      FROM   documents
      WHERE  name = l_filename;
    -- Add header
      HTP.init;
      OWA_UTIL.mime_header(l_mime_type, false);
      HTP.print('Content-Length: ' || DBMS_LOB.getlength(l_blob_content));
      HTP.print('Content-disposition: inline; filename="'|| l_filename ||'"');
      OWA_UTIL.http_header_close;
    -- get document 
      WPG_DOCLOAD.download_file(l_blob_content);
    EXCEPTION
      WHEN OTHERS THEN
        HTP.htmlopen;
        HTP.headopen;
        HTP.title('File Downloaded');
        HTP.headclose;
        HTP.bodyopen;
        HTP.header(1, 'Download Status');
        HTP.print('Download of ' || l_filename || ' failed.');
        HTP.print(SQLERRM);
        HTP.bodyclose;
        HTP.htmlclose;
    END download;All files will download okay but the acrobat container doesn't open right away and show a progress bar. It waits for the entire file to download, then opens the file. This becomes a bigger issue when the file size increases because it appears as though the site hangs until the document appears.
    If I place a file on a site directory instead of inside the database, create a link to it and click it, acrobat opens right away and displays progress. I want to get the site to open blob stored files in adobe right away and show download progress as if the file was stored on a site folder.
    Any ideas? Thanks

    Add this line to the content header
    HTP.print('Accept-Ranges: bytes');

Maybe you are looking for

  • How many computers can Elements 11 run on?

    I am thinking of downloading elements 11 and my mom wants to know if she can use it too; if I buy it can I download and run the installation on more than one computer?

  • How to create Chart within a web page NOT as seperate page?

    Hi, I am using JCharts and am trying to figure out how (or if it is even possible) to create a chart and then place it in a web page. All the examples I've seen show you how to create a JPEG of the chart and then link to this image from your web page

  • Officejet 6310 prints solid black line instead of text.

    Good day. My officejet 6310 has started printing a 3/8" solid black line instead of text. I've replaced both color and black cartridges. I've also run align and clean cartridges. Does anyone have helpful suggestions?

  • Request creation error for mitigation control workflow

    Dear Expert,          I had activiate the workflow from RAR to CUP on Mitigated User assignment, I had completed following customizing: 1)RAR->configaration->Workflow 2)CUP->configaration->initiator, stage, path. but when I created mitigated user ass

  • Authorization to change attribute co.code

    Hi, We have tested and see that authorization to change attributes is coming from role /SAPSRM/MANAGER. Our goal in here is to make the attribute company code to be changeable for purchaser, but the purchaser cannot change other attribute. Can someon