Images to Blob

Hi.
I'm passing images about in a data object, for display purposes.
I'm retrieving it from a MySQL database using getBlob().getBytes() which works fine.
My question is how do I get the image back into the database if need be - ie. get a bytearray or a stream from that image so I can place it in the blob?
Thanks very much.

http://forum.java.sun.com/thread.jsp?forum=48&thread=446603

Similar Messages

  • Problem Displaying image from blob

    Hi all,
    I m using,
    Database : 10g Rel 2
    Frontend : DevSuite 10g
    OS : WinXp
    Browser : IE 6
    Problem : In my forms i m displaying images from blob column but some of the images are not displayed. I have tried with all image formats available in combination with all available display quality but no luck. What could be the reason for it and how do i solve it?
    Can anyone help me plz?
    Thnx in advance.
    Imtiaz

    Hello,
    It is very difficult for us to "guess" what images you can read and what others you cannot.
    Maybe you could provide more information on images that are not displayed ?
    What is their native format ?
    Francois

  • How can i store image into blob field in oracle express ??

    Hi
    am using oracle express *(2.1)* , i am devloping a small system , we have to store an image in blob filed in a table, we have to create a form which allow the user to store the image in the table and to generate a report contains the image
    any note's please
    tahnk's in advance
    sam
    Edited by: user485341 on Dec 22, 2008 1:28 AM

    hi Andy
    this is the code for download
    create or replace PROCEDURE download_my_file(p_file in number) AS
    v_mime VARCHAR2(48);
    v_length NUMBER;
    v_file_name VARCHAR2(2000);
    Lob_loc BLOB;
    BEGIN
    SELECT MIME_TYPE, BLOB_CONTENT, FILE_NAME,DBMS_LOB.GETLENGTH(BLOB_CONTENT)
    INTO v_mime,lob_loc,v_file_name,v_length
    FROM A_IMAGES
    WHERE IMAGE_ID = p_file;
    owa_util.mime_header( nvl(v_mime,'application/octet'),FALSE );
    -- set the size so the browser knows how much to download
    htp.p('Content-length: ' || v_length);
    -- the filename will be used by the browser if the users does a save as
    htp.p('Content-Disposition: attachment;
    filename="'||replace(replace(substr(v_file_name,instr(v_file_name,'/')+1)
    ,chr(10),null),chr(13),null)|| '"');
    -- close the headers
    owa_util.http_header_close;
    -- download the BLOB
    wpg_docload.download_file( Lob_loc );
    end download_my_file;
    thank's

  • Display image from BLOB field (png image)

    Hello,
    On my database i have a function which return BLOB (png image from a webservice)..
    Is there some tutorial or sample code how to display a image froma blob field in oracle reports?
    thank you

    You can create a view and base your report on that view. The view would be something like:
    create or replace view my_view as
    select my_blob_function() image
    from ...In your Report it would just be:
    select image
    from my_viewNow, I'm not sure if Reports supports png format, though.
    There are many examples to be found, e.g.
    http://download.oracle.com/docs/html/B10602_01/orbr_dyngraph.htm

  • How to load images from BLOB to javascript?

    hi, Guys:
    I need to load thumbnail images from BLOB to multiple markers' infowindow in Google map . I have implemented Google map in APEX. I load the data suchas text for every marker's infowindow from Oracle database table with PL/JSON, and infowindow works fine. Could anyone give me a suggestion or example so I know how to load images to javascript?
    Thanks a lot.
    Database: Oracle 11g R2
    APEX: APEX 4.1
    Thanks.
    Sam

    lxiscas wrote:
    hi, VC:
    Thanks for your kind reply. I need to render these images out of APEX session, actually in javascript that is related to Google map markers' infowindow.
    I checked the documents of APEX_UTIL.GET_BLOB_FILE_SRC, but my impression is I need to use it in APEX instead of javascript if my understanding is correct. I already implemented a procedure with PL/SQL to load images from a BLOB column in Oracle database. But the problem is, how can I pass it to javascript code out of APEX to javascript (I could pass text or number from APEX to javascript with PL/JSON though,But I assume that still google map will be within a valid apex session? if so you should be able to use the above api.
    Basically what this api does is generates a kind of url to each blob in the database, not sure how google api's deal with this though. Why don't you give it a try?
    The other option is to make your pl/sql procedure public and then you can generate the json to include the images urls such as:
         "employees" : [{
                   "firstName" : "John",
                   "lastName" : "Doe",
                   "imgSrc" : "http://somewhere/db_schema.your_download_proc?p_file=#ID#",
                   "firstName" : "Anna",
                   "lastName" : "Smith"
                   "imgSrc" : "http://somewhere/db_schema.your_download_proc?p_file=#ID#",
                   "firstName" : "Peter",
                   "lastName" : "Jones"
                   "imgSrc" : "http://somewhere/db_schema.your_download_proc?p_file=#ID#",
    }And then you can use this new attribute to populate the images in javascript using standard img tag
    See this tutorial http://docs.oracle.com/cd/E14373_01/appdev.32/e13363/up_dn_files.htm
    I did not find any method in PL/JSON to pass image object)? So far I only found example to load images from local files to javascript.Hmm..I don't think you should load image objects.
    Vikram

  • Display image file - BLOB on Report

    Hello there,
    Has anyone knew how to display an image file (BLOB) on Report using Application Express?
    You prompt reply would be appreciated.

    Once htmldb.oracle.com is available again, you may have a look in my demo application:
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    In the tab section II, you will find an image display example and the corresponding
    procedure.
    Denes Kubicek

  • Help abt store and delete images as blob & bfile using Visual C++

    Hi
    Does anyone knows if there is code for visual c++
    to store and delete images as blob or bfile?
    thanx

    The documentation states there are examples in the oracle database distribution: <ORACLE_HOME>/rdbms/demo/cdemolb.c <ORACLE_HOME>/rdbms/demo/cdemolb2.c <ORACLE_HOME>/rdbms/demo/cdemolbs.c
    These examples are in c, but can be used in c++
    http://otn.oracle.com/doc/server.815/a67846/app_exam.htm#430289

  • Image from BLOB now showed when page cache set

    Hello,
    I have a page that display images from BLOB,
    After setting page cache to 1hour, page load faster but images not showed.
    Please help me on this.
    Thank you.

    Hi Halit,
    For me i dont thing, this problem occurred. As i checked by setting the page cache to 1 hour. After that images loaded normally as usual.
    I tried with my mozilla browser. In which browser you tried, may be your browser fault.
    Kindly check it.
    Brgds,
    Mini
    Mark Answers Promptly

  • How to import images into BLOB datatypes

    Dear All,
    I'm trying to import image into BLOB table type.I'm executing this SQL commands but found error.
    ORA-22288
    ORA-06512
    Please help me i'll be thank full.
    Regards
    FAHEEM LATIF
    CREATE OR REPLACE DIRECTORY images AS 'C:\IMAGES';
    CREATE TABLE test007 (column1 BLOB);
    DECLARE
    l_bfile BFILE;
    l_blob BLOB;
    BEGIN
    INSERT INTO test007 (column1)
    VALUES (empty_blob())
    RETURN column1 INTO l_blob;
    l_bfile := BFILENAME('IMAGES', 'MyImage.gif');
    DBMS_LOB.fileopen(l_bfile, Dbms_Lob.File_Readonly);
    DBMS_LOB.loadfromfile(l_blob, l_bfile, DBMS_LOB.getlength(l_bfile));
    DBMS_LOB.fileclose(l_bfile);
    COMMIT;
    END;
    /

    I know your original pl/sql routine contained a COMMIT, but did you use the same code with the COMMIT? If not, are you checking the table from a different session?
    I ran your same code and it worked without issues. Are saying if you do a SELECT COUNT(*) from test007 it returns zero rows?

  • Loading Images into BLOB.

    I have written pl/sql code for mass load of images into blob. When user is trying to access it from front end. some of the images are corrupted. means blank page is displayed but for other the actual image is displayed. So is there any size limitation on blob images???mostly images i am storing is of 20kb - 300kb.
    Thanks in advance.

    There is a definite limit to the size of blobs you can store. That limit is (4GB-1 byte)*(block size) which means between 8 and 128TB.
    I highly doubt your issue is storing the BLOBs in the Oracle database though since you thought it unimportant to post version information, DDL, or DML no one can possibly tell for sure.
    I would be far more suspicious of whatever tool, also unmentioned, being used to retrieve and display them.

  • How to load an image into blob in a custom form

    Hi all!
    is there some docs or how to, load am image into a database blob in a custom apps form.
    The general idea is that the user has to browse the local machine find the image, and load the image in a database blob and also in the custom form and then finally saving the image as blob.
    Thanks in advance
    Soni

    If this helps:
    Re: Custom form: Take a file name input from user.
    Thanks
    Nagamohan

  • Problem in viewing the Image in BLOB

    Hi,
    I am using the Toad 8.0. I have one problem, I inserted approx 2.5 million records in one table say V_Images using the SQL Loader, there are few records in Table where image is not loaded properly. Approx 99% is done only 1% is having wrong data, We want to identify and delete that, where no image is loaded. Is there any function or method to check those records which doesnt have Image.
    Please let me know,
    Thanks in adv.

    You can probably check the Length of the BLOB column.

  • How to display images from BLOB column via APEX 4.0

    Hello,
    I did the following in order to display images of two Oracle records on the APEX page. I am using APEX Version : 4.0.1.00.03 , Oracle DB Version : 10.2.0.4.0.
    1. Created An oracle table TEST_FORM
    with 3 columns
    ( ID number, MIME_TYPE varchar2(255) , Image BLOB )
    2. Inserted two records
    10001, image/gif, ( actual image1)
    10002, image/gif, ( actual image2)
    3. created an Oracle procedure
    CREATE OR REPLACE PROCEDURE show_my_form ( p_image_id IN test_form.id%type) AS
    l_mime test_form.mime_type%type;
    l_length NUMBER;
    l_file_name VARCHAR2 (2000);
    lob_loc test_form.IMAGE%type;
    BEGIN
    SELECT mime_type, IMAGE
    , DBMS_LOB.getlength (IMAGE)
    INTO l_mime, lob_loc, l_length
    FROM test_form
    WHERE id = p_image_id;
    owa_util.mime_header(l_mime, false);
    htp.p ('Content-length: ' || l_length);
    owa_util.http_header_close;
    wpg_docload.download_file (lob_loc);
    END show_my_form ;
    4. In Apex 4.0
    step1. Created an interactive report on a new APEX page
    step2. Specified the following in the Region Source
    select id, mime_type, '<img src="#OWNER#.show_my_form ?p_image_id=#ID#" />' photo
    from TEST_FORM
    The column result shows as <img src="CCS.show_my_form?p_image_id=#ID#" />
    I am unable to display the column image as a link to a proper image photo.
    Could you please advise me if I missed anything ?
    Thanks a lot.
    Regards
    Susanna
    Edited by: user10318332 on 13/12/2010 15:51
    Edited by: user10318332 on 13/12/2010 20:10

    Maybe the space you have before the ? is causing issues. there shouldn't be any space.
    Your procedure looks to be much the same of one that I have.
    Have you granted execute on your procedure?
    Also, what version DB are you running? This could be another issue: http://daust.blogspot.com/2006/04/xe-calling-stored-procedures.html
    But anyway, you don't need to create your own procedure these days. You could do the following:
    in your query, have a column: dbms_lob.getlength(blob) photo ; save, then in column attributes for that column, apply a format mask. There is usually a link below the text box for the format mask - BLOB Download Format Mask, which will help you build the format mask. But it is documented here: http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/advnc.htm#BCGGJHEF
    Ta,
    Trent

  • Display image for BLOB  Download link in Interactive Report

    I have a table containing BLOB data and am displaying the table in an interactive report. I would like to replace the "Download" text link with an icon that represents the MIME type of the BLOB, but can't seem to find a way to make the substitution. Does anyone know how to do this? Thanks.
    -Jeff

    Hey Ben,
    Thanks for the suggestion. I understand what you are saying, the problem is that when you have an interactive report that includes a BLOB and you use the built-in method for displaying a download link, it only gives you the option of using a text link. The method is outlined in the online help under:
    Home > Advanced Programming Techniques> About BLOB Support in Forms and Reports > About BLOB Support in Reports
    This is done by using the following syntax in the Number/Date Format of the column attribute of the BLOB:
    DOWNLOAD:CC_DOCUMENTS:CONTENTS:ID::MIME_TYPE:FILENAME:UPDATED_ON::attachment:View
    Where the last parameter is the link text. The only problem is that there is no option for substituting an image rather than the link text. That's what I'm trying to work around. Sorry if you new all of this already, but I wanted to explain what I've already done. Thanks for any help you can offer.

  • Insert Image to BLOB column

    Hi,
    How can i insert a image/largefile into table (having BLOB column) from sql plus?
    Thanks

    Hi!
    Do this with PL/SQL.
    CREATE TABLE image_tbl
      filename VARCHAR2(4000),
      image   BLOB
    DECLARE
          v_blob       BLOB;
          v_srcfile    BFILE;
    BEGIN
          DBMS_LOB.CreateTemporary(v_blob, TRUE);
          DBMS_LOB.Open(v_blob, dbms_lob.Lob_ReadWrite);
          v_srcfile := Bfilename('IMAGE_DIR', 'image.gif');
          DBMS_LOB.FileOpen (v_srcfile, dbms_lob.File_ReadOnly);
          DBMS_LOB.LoadFromFile(v_blob, v_srcfile, DBMS_LOB.GetLength(v_srcfile));
          INSERT INTO image_tbl (filename, image)
          VALUES ('image.gif', EMPTY_BLOB());
          UPDATE image_tbl
          SET image = v_blob
          WHERE filename LIKE 'image.gif';
          DBMS_LOB.FileClose(v_srcfile);
          COMMIT;
    END;I hope that one will help you.
    yours sincerely
    Florian W.

  • CRXIR2 image from blob field and some fonts not displaying in PDF export

    I used CRXIR2 developer edition to create a report linked to a SQL 2000 database table.  There is a blob field containing a JPG image that is different for each record in the table.  I am using VB.NET code with ASP.NET 2.0 to programmatically change the temp file to a local folder for easy cleanup, open this crystal report with the 11.5.3700.0 version of the assemblies, set the datasource to a DataTable extracted from the DB, and then export to a PDF file.
    The code for creating the PDF is:
            Dim TempRoot As String = MapPath(".") & "\temp\"
            Dim oldTmp As String = System.Environment.GetEnvironmentVariable("TMP")
            System.Environment.SetEnvironmentVariable("TMP", TempRoot)
            Dim objReport As New ReportDocument()
            objReport.Load(MapPath(".") & "\CReports\" & ReportName)
            For lnX As Integer = 0 To objReport.Database.Tables.Count - 1
                    objReport.Database.Tables(lnX).SetDataSource(resultTable)
            Next
            Dim objDestinationOptions As New DiskFileDestinationOptions()
            Dim objExportOptions As New ExportOptions()
            Dim objFormatTypeOptions As New CrystalDecisions.Shared.PdfRtfWordFormatOptions()
            Dim pdfName As String = "test.pdf"
            objDestinationOptions.DiskFileName = MapPath(".") & "\temp\" & pdfName
            objExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat
            objExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
            objExportOptions.ExportDestinationOptions = objDestinationOptions
            objReport.Export(objExportOptions)
            objReport.Dispose()
            System.Environment.SetEnvironmentVariable("TMP", oldTmp)
    When I run the site locally in VS2008, everything works fine and a PDF contains the graph and all the fonts are correct.
    However, when I run the exact same site from a web server running IIS6, the PDF generated does not have the image, and some of the fonts are substituted (all of the necessary fonts are installed on the IIS server).
    Please help!

    Hi Don,
    I am able to see the image and export from the CR Designer on my machine running XP.  However, I installed the designer on our IIS server running Server 2003, and the image does not show in the designer preview on that machine.
    I found another forum thread that you are involved in (1902383) that seems to be dealing with this exact issue, and it looks like there may not be a resolution.
    I am going to try a different route - instead of pulling in the SQL Image field directly, I am going to write it out to a temporary file and pull it in by altering the graphic location of the picture object in the report.
    I'll let you know how that works.
    Pete

Maybe you are looking for

  • Unable to download using IE 10 or 11

    Hello I have Windows 7 32-bit PC's with full updates. We are on a domain network, however, I have tested the problem as I'm about to describe on my home Windows 7 64-bit PC, and it behaves the same. Using IE11, I cannot download anything, no messages

  • Webpage not highlighted on google search list after being viewed

    I am using an Acer Aspire One netbook running XP. I do a google search using Mozilla Firefox 3.6.22 and get the usual list of search results. Now when I view a website from the search list and then go back to the search list there is nothing indicati

  • Problem with nokia N81

    Hello  I have a nokia N81 and i recently installed whatsapp. While configuring it I was asked to enter the Username I entered my name on hitting the continue button the application closed automatically. Its annoying and I an unable to use the applica

  • Query to show the values of Keyfigures with above 200(201,202.....) as 200

    Hi all, query has to show the values of keyfigures with above 200(201,202.....) as 200. for example james         200 willy           180 Jhones       450 kiris            204 and so on. the values above 200 that is 450 204 has 200 in the query outpu

  • Logic Studio, not compatible with my new iMac?? downloads or updates available?

    I just bought a new IMAC 21.5 And Logic Studio from Apple Store. After installing Logic I get the message that Logic doesn't support my version of computor? Spec PROCESSOR 3.1GHz Quad-Core Intel Core i7 MEMORY 16GB 1600MHz DDR3 SDRAM-2X8GB HARD DRIVE