Save Uploaded file in BLOB column of Database

Hey,
Anyone knows how to save uploaded file in BLOB column of database.
Please need help asap.
i get following error:
Cannot convert org.apache.myfaces.trinidadinternal.config.upload.UploadedFiles$FixFilename@1c1fc8d of type class org.apache.myfaces.trinidadinternal.config.upload.UploadedFiles$FixFilename to class oracle.jbo.domain.BlobDomain.
Can anyone tell me what needs to be done.
Thanks,
Sneha

Hi Timo,
We are using oracle Jdeveloper Studio Edition Version 11.1.1.6.0 . logs are just showing nullpointer exception. Following errors are shown in logs:
<ActionListenerImpl> <processAction> java.lang.NullPointerException
javax.faces.el.EvaluationException: java.lang.NullPointerException
  at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
  at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
  at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
  at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
  at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
  at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
  at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
  at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
  at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
  at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
  at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
  at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
  at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1018)
  at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:386)
  at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
  at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
  at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
  at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
  at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
  at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
  at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
  at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
  at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
  at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
  at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
  at java.security.AccessController.doPrivileged(Native Method)
  at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
  at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
  at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
  at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
  at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
  at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
  at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
  at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
  at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
  at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
  at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
  at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
  at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: java.lang.NullPointerException
  at view.bean3.ImageBean.uploadFileValueChangeEvent(ImageBean.java:80)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at com.sun.el.parser.AstValue.invoke(Unknown Source)
  at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
  at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
  ... 51 more
<LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase INVOKE_APPLICATION 5
javax.faces.FacesException: #{samplebean2.uploadFileValueChangeEvent}: java.lang.NullPointerException
And one more error i get and i.e.
XmlErrorHandler> <handleError> ADF_FACES-60096:Server Exception during PPR, #1
javax.servlet.ServletException: java.lang.NullPointerException
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
  at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
  at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
  at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
  at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
  at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
  at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
  at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
  at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
  at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
  at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
  at java.security.AccessController.doPrivileged(Native Method)
  at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
  at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
  at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
  at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
  at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
  at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
  at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
  at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
  at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
  at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
  at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
  at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
  at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
  at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
  at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
  at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
  at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
  at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
  at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
  at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
  at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
  at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
  at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
  at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
  at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
  at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
  at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
  at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1018)
  at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:386)
  at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
  ... 36 more
Caused by: java.lang.NullPointerException
  at view.bean3.ImageBean.uploadFileValueChangeEvent(ImageBean.java:80)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at com.sun.el.parser.AstValue.invoke(Unknown Source)
  at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
  at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
  ... 51 more
<Utils> <buildFacesMessage> ADF: Adding the following JSF error message: Attempt to access dead view row of persistent id 17
oracle.jbo.DeadViewRowAccessException: JBO-27102: Attempt to access dead view row of persistent id 17
Can you help me on this one. Any other details you need let me know.

Similar Messages

  • HOW TO WRITE ,SAVE A FILE IN BLOB COLUMN

    Hi,
    I have to write a simple utl file and store it in a column of blob data tye..i hav written a piece of code..it shows invalid path as error..please kindly help me
    create or replace
    procedure simp_file as
    fhandler                    utl_file.file_type;
    f_dir                    VARCHAR2(100);
    f_file                    VARCHAR2(100);
    BEGIN
    f_dir := 'C:/utl/';
    f_file := 'Kings.txt';
         BEGIN
              fhandler := utl_file.fopen(f_dir,f_file,'a');
         EXCEPTION
         WHEN utl_file.invalid_path THEN
              f_dir := 'C:/utl/';
              fhandler := utl_file.fopen(f_dir,f_file,'a');
         END;
         utl_file.new_line(fhandler,1);
    utl_file.putf(fhandler,'hi');      
    utl_file.fclose(fhandler);
    EXCEPTION
    WHEN UTL_FILE.INVALID_PATH THEN
    IF (utl_file.is_open(fhandler)) THEN
    utl_file.fclose(fhandler);
    END IF;
    raise_application_error(-20101, 'Invalid path');
    END simp_file;

    May be..
    SQL> CREATE TABLE test_blob (id INTEGER,blob_col BLOB);
    Table created.
    SQL> DECLARE
      2    file_handle UTL_FILE.file_type;
      3    v_fname     VARCHAR2(20) := 'mytest.txt';
      4    buffer      VARCHAR2(32767);
      5  BEGIN
      6    file_handle := UTL_FILE.fopen('TEST_DIR', v_fname, 'W');
      7    buffer      := 'This is first line';
      8    UTL_FILE.put_line(file_handle, buffer, TRUE);
      9    buffer := 'This is second line';
    10    UTL_FILE.put_line(file_handle, buffer, TRUE);
    11    buffer := 'This is third line';
    12    UTL_FILE.put_line(file_handle, buffer, TRUE);
    13    UTL_FILE.fclose(file_handle);
    14  END;
    15  /
    PL/SQL procedure successfully completed.
    SQL> DECLARE
      2    v_src_loc BFILE := BFILENAME('TEST_DIR', 'mytest.txt');
      3    v_amount  INTEGER;
      4    v_b       BLOB;
      5  BEGIN
      6    DBMS_LOB.OPEN(v_src_loc, DBMS_LOB.LOB_READONLY);
      7    v_amount := DBMS_LOB.GETLENGTH(v_src_loc);
      8    INSERT INTO test_blob
      9    VALUES
    10      (1, EMPTY_BLOB())
    11    RETURNING blob_col INTO v_b;
    12    DBMS_LOB.LOADFROMFILE(v_b, v_src_loc, v_amount);
    13    DBMS_LOB.CLOSE(v_src_loc);
    14  END;
    15  /
    PL/SQL procedure successfully completed.
    SQL> commit;
    Commit complete.Then display
    SQL> DECLARE
      2      v_lob_loc BLOB;
      3      CURSOR cur IS
      4         SELECT id, blob_col FROM test_blob;
      5       v_rec test_blob%ROWTYPE;
      6     BEGIN
      7       OPEN cur;
      8       LOOP
      9         FETCH cur
    10          INTO v_rec;
    11        v_lob_loc := v_rec.blob_col;
    12         DBMS_OUTPUT.PUT_LINE('The length is: ' ||
    13                              DBMS_LOB.GETLENGTH(v_lob_loc));
    14         DBMS_OUTPUT.PUT_LINE('The ID is: ' || v_rec.id);
    15         DBMS_OUTPUT.PUT_LINE('The blob is read: ' ||
    16                              UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(v_lob_loc,
    17                                                                       200,
    18                                                                       1)));
    19         EXIT WHEN cur%NOTFOUND;
    20       END LOOP;
    21       CLOSE cur;
    22   END;
    23  /
    The length is: 61
    The ID is: 1
    The blob is read: This is first line
    This is second line
    This is third line
    The length is: 61
    The ID is: 1
    The blob is read: This is first line
    This is second line
    This is third line
    PL/SQL procedure successfully completed.

  • How to Save Word File In BLOB

    I am very new to above sujbect . i have to save on file in BLOB and reterv it
    any one have sample form any help from anyone...
    thanks

    What version of Forms ? what version of database ?
    do you want to do the job within Forms or with pl/sql stored functions ?
    Francois

  • After uploading file in BLOB using webutil file on system locked?

    I uploaded file in BLOB using webutil upload utility. But after uploading it locks the file and i cannot delete the file unless i close the iexplorer window.
    Is there any way to unlock the file and delete it with out closing the application(iexplorer). If any body knows please reply.
    Regards,
    Muhammad Qazzafi

    can you post the statements, which you use for the upload ?
    thx
    Gerd

  • Someone used upload files into blob in JDeveloper 10.1.3.2 ?

    Someone used upload files into blob in JDeveloper 10.1.3.2 ?
    I used Steve Muech example 85, but after downloading , downloaded files doesn't work ?
    I prepared test case http://www.sttb.pl/jakub/UploadAndDownloadBlob.zip - meybe someone resolve it.
    Regards
    Kuba

    Hi,
    There is no problem with download in above example. I have used Steve's example to upload, and solution delivered by Ric Smith on his blog to download files. I think there is something wrong with Steve's uploading solution. When I used Ric solution (he sent me by email complete JDeveloper project) to upload and download everyting works correct. I created last Friday SR on Metalink to review it and it's still in progress. My advice is:
    1) Look onto Ric Smith blog:
    http://thepeninsulasedge.com/blog/2006/08/17/reading-and-writing-blobdomains-to-and-from-an-adf-uploadfile/
    and
    http://thepeninsulasedge.com/blog/2006/11/06/adf-faces-and-adf-bc-fileupload-and-blobs-continued/
    2) Ask him to send JDeveloper project or update email to your profile - I'll send you directly this project that I retrieved from Ric Smith
    Regards
    Kuba

  • Logic to upload file with dynamic columns

    hi
    in my requirement i hav given to add logic to upload file with dynamic columns so that this upload program can be reused.
    this way the program is flexible, irrespective of the number of columns in the file.
    can any one explain this?
    and let me know what actually i hav to do.

    Check the program and the dynamic column is in the col_pos internal table and in the routines get_structure onwards.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/scm/dynamic%2bstructures%2band%2bcomponents
    cheers
    Aveek

  • Problem in uploading a file to BLOB column in ADF

    Hi,
    I was trying to upload a file and storing into BLOB column in the DB. I was trying the exercise that was given in
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html85th sample application.
    When I was running my application, it kept on repeating the 'Please supply a valid file name to upload' messge. I do select a file and then click 'Upload' button. While clicking 'Upload' button I am getting this messge.
    Could you please help me in resolving this issue?
    And I see 10.1.3.2 version of jdev ready for download in forum. Could you please tell me whether the issue that was present in uploading a file to the database is resolved in this version or not? Can I use this version for my ADF application?
    Please let me know.
    Thanks,
    Priya.S

    The example doesnt work correctly. It throws an exception as in http://www.oracle.com/technology/products/jdev/htdocs/10.1.3.1/10.1.3.1addendum.html#upload
    It is also mentioned that 10.1.3.2 doesnt have this issue. So can I use the recent jdev for my ADF application?
    Thanks,
    Priya.S

  • How to Upload a PDF file into BLOB column in a table using 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.

    Hi,
    please, search a bit on the forum before do a question:
    Just searching by "upload blob pdf" ...
    How to batch upload PDF files into database BLOB
    Regards,
    Jose.

  • 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 Upload a PDF file into BLOB column in a table using Forms 6i

    Can anyone tell me how to upload a PDF file from client and store its content in BLOB column in a table. The file will be genered using reports and win be stored in db.The file to be uploaded will be in client side.
    Thank´s.

    If you are using version 9 or 10 use webutil.... Look in webutil.pll.
    Use either one these two fuctions...
    FUNCTION Client_To_DB( clientFile       in VARCHAR2,
                             tableName        in VARCHAR2,
                             columnName       in VARCHAR2,
                             whereClause      in VARCHAR2,
                             asynchronous     in BOOLEAN default FALSE,
                             callbackTrigger  in VARCHAR2 default NULL) return BOOLEAN;
      FUNCTION Client_To_DB_With_Progress
                         (   clientFile       in VARCHAR2,
                             tableName        in VARCHAR2,
                             columnName       in VARCHAR2,
                             whereClause      in VARCHAR2,
                             progressTitle    in VARCHAR2,
                             progressSubTitle in VARCHAR2,
                             asynchronous     in BOOLEAN default FALSE,
                             callbackTrigger  in VARCHAR2 default NULL) return BOOLEAN;

  • Uploaded Files stored in Oracle 10G database or in Unix File system

    Hey All,
    I am trying to understand best practices on storing uploaded files. Should you store within the database itself (this is the current method we are using by leveraging BLOB storage) or use a BFILE locator to use the files system storage (we have our DB's on UNIX) . . .or is there another method I should be entertaining? I have read arguments on both sides of this question. I wanted to see what answers forum readers could provide!! I understand there are quite a few factors but the situation I am in is as follows:
    1) Storing text and pdf documents.
    2) File sizes range from a few Kb to up to 15MB in size
    3) uploaded files can be deleted and updated / replaced quite frequently
    Right now we have an Oracle stored procedure that is uploading the files binary data into a BLOB column on our table. We have no real "performance" problems with this method but are entertaining the idea of using the UNIX file system for storage instead of the database.
    Thanks for the insight!!
    Anthony Roeder

    Anthony,
    First word you must learn here in this forum is RESPECT.
    If you require any further explanation, just say so.
    BLOB compared with BFILE
    Security:
    BFILEs are inherently insecure, as insecure as your operating system (OS).
    Features:
    BFILEs are not writable from typical database APIs whereas BLOBs are.
    One of the most important features is that BLOBs can participate in transactions and are recoverable. Not so for BFILEs.
    Performance:
    Roughly the same.
    Upping the size of your buffer cache can make a BIG improvement in BLOB performance.
    BLOBs can be configured to exist in Oracle's cache which should make repeated/multiple reads faster.
    Piece wise/non-sequential access of a BLOB is known to be faster than a that of a BFILE.
    Manageability:
    Only the BFILE locator is stored in an Oracle BACKUP. One needs to do a separate backup to save the OS file that the BFILE locator points to. The BLOB data is backed up along with the rest of the database data.
    Storage:
    The amount of table space required to store file data in a BLOB will be larger than that of the file itself due to LOB index which is the reason for better BLOB performance for piece wise random access of the BLOB value.

  • Loading PDF and Video Files in BLOB Column

    Hi,
    Below is my database version
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    The Requirment is
    In a web page ( developed using Java Spring ) end user has the funtionality to upload a pdf/video file by browse the required file from his/her local computer.
    Once the webuser clicks the SAVE button then the selected file needs to be inserted in Oracle BLOB column.
    Front end needs to call an Oracle Package to achive this.
    Please suggest me how to create oracle code(Procedure) for this?
    Thanks in advance.
    Regards,
    Karthik.K

    Check BFILENAME + DBMS_LOB. Something like:
    DECLARE
        v_file BFILE;
        v_blob BLOB;
        v_size NUMBER;
    BEGIN
        v_file := BFILENAME(<ORACLE DIR OBJECT POINTING TO OS DIR WHERE FILE RESIDES>,<FILE NAME>);
        DBMS_LOB.OPEN (v_file, DBMS_LOB.lob_readonly); --Read the file
        DBMS_LOB.createtemporary(v_blob,TRUE);
        v_size := DBMS_LOB.getlength(v_file);
        DBMS_LOB.loadfromfile(v_blob,v_file,v_size);
    END;
    /SY.
    Edited by: Solomon Yakobson on Aug 24, 2011 10:01 AM

  • Load .bmp file into BLOB column in 9i - how to?

    Hello all,
    How do I update a table with a BLOB column with a .bmp file in 9i? I tried using the DBMS_LOB package but got a ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275 (and since there is more native support in 9i, I'm not sure I need it to begin with). We do not have Inter-Media. tia [email protected]

    Hi,
    please, search a bit on the forum before do a question:
    Just searching by "upload blob pdf" ...
    How to batch upload PDF files into database BLOB
    Regards,
    Jose.

  • Upload file in JSP with Oracle Database 10gR2

    How to upload file with oracle database 10gR2??
    i can't find how to upload..
    i've tried to create a procedure in oracle and execute in netbeans but the file save in directory and then from directory save to database.
    it means the file save in 2 location, in directory and database..
    does anybody know how to save file direct from the JSP file into database without save in directory?
    this is the procedure..
    create or replace PROCEDURE load_file (
    p_id number,
    p_photo_name in varchar2) IS
    src_file BFILE;
    dst_file BLOB;
    lgh_file BINARY_INTEGER;
    BEGIN
    src_file := bfilename('DIR_TEMP', p_photo_name);
    -- insert a NULL record to lock
    INSERT INTO temp_photo
    *(id, photo_name, photo)*
    VALUES
    *(p_id , p_photo_name ,EMPTY_BLOB())*
    RETURNING photo INTO dst_file;
    -- lock record
    SELECT photo
    INTO dst_file
    FROM temp_photo
    WHERE id = p_id
    AND photo_name = p_photo_name
    FOR UPDATE;
    -- open the file
    dbms_lob.fileopen(src_file, dbms_lob.file_readonly);
    -- determine length
    lgh_file := dbms_lob.getlength(src_file);
    -- read the file
    dbms_lob.loadfromfile(dst_file, src_file, lgh_file);
    -- update the blob field
    UPDATE temp_photo
    SET photo = dst_file
    WHERE id = p_id
    AND photo_name = p_photo_name;
    -- close file
    dbms_lob.fileclose(src_file);
    END load_file;

    Well your Oracle procedure is designed to load a file, so that's what it does. If you want it to load from a data stream such as an upload, you need to rewrite it accordingly.
    So far this is not a Java question at all.

  • Error while Uploading File using BLOB

    Hi All,
    I am trying to upload file into Database using simple JHeadstart generated screen for a table with a column having BLOB attribute. Wile inserting, I get this error message.
    JBO-25009: Cannot create an object of type:oracle.jbo.domain.BlobDomain with value:oracle.adfinternal.view.faces.webapp.UploadedFiles$FixFilename@1930089
    Any help would be appreciated..
    Mamun

    The problem you're getting is because the af:inputFile component does not support uploading into columns other than OrdDoc, OrdImage, OrdVideo types.
    I think you would need to implement the interface oracle.adf.view.faces.webapp.UploadedFileProcessor in a custom class which would
    handle the file upload and configure it in the
    adf-faces-config.xml file e.g.:
    <uploaded-file-processor>packagename.FileUploadProcessor</uploaded-file-processor>
    Someone correct me if I'm wrong, as I haven't tried it out myself yet.

Maybe you are looking for