Rendering images based on BLOB columns

Hello
I'm using JDevelpor 10G ..
I want to render image from BLOB column , and its the first time working with servlet , I read this article
http://www.pascalalma.net/2008/04/22/oracle-adf-medior-rendering-images-based-on-blob-columns/
and I want to ask some questions ??
- How can I check that the servlet is run .. I use this to call the servlet "" Do not laugh .. I am really new "
<af:objectImage source="/render_image?img_id=#{row.ImageId}"/>
You should read the article to understand my question
rgds

done , my problem was with mapping
If you have any problem with this case I can help
contact me
[email protected]

Similar Messages

  • How to insert a pdf or jpeg image into a blob column of a table

    How to insert a pdf or jpeg image into a blob column of a table

    Hi,
    Try This
    Loading an image into a BLOB column and displaying it via OAS
    The steps are as follows:
    Step 1.
    Create a table to store the blobs:
    create table blobs
    ( id varchar2(255),
    blob_col blob
    Step 2.
    Create a logical directory in the database to the physical file system:
    create or replace directory MY_FILES as 'c:\images';
    Step 3.
    Create a procedure to load the blobs from the file system using the logical
    directory. The gif "aria.gif" must exist in c:\images.
    create or replace procedure insert_img as
    f_lob bfile;
    b_lob blob;
    begin
    insert into blobs values ( 'MyGif', empty_blob() )
    return blob_col into b_lob;
    f_lob := bfilename( 'MY_FILES', 'aria.gif' );
    dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
    dbms_lob.loadfromfile( b_lob, f_lob, dbms_lob.getlength(f_lob) );
    dbms_lob.fileclose(f_lob);
    commit;
    end;
    Step 4.
    Create a procedure that is called via Oracle Application Server to display the
    image.
    create or replace procedure get_img as
    vblob blob;
    buffer raw(32000);
    buffer_size integer := 32000;
    offset integer := 1;
    length number;
    begin
    owa_util.mime_header('image/gif');
    select blob_col into vblob from blobs where id = 'MyGif';
    length := dbms_lob.getlength(vblob);
    while offset < length loop
    dbms_lob.read(vblob, buffer_size, offset, buffer);
    htp.prn(utl_raw.cast_to_varchar2(buffer));
    offset := offset + buffer_size;
    end loop;
    exception
    when others then
    htp.p(sqlerrm);
    end;
    Step 5.
    Use the PL/SQL cartridge to call the get_img procedure
    OR
    Create that procedure as a function and invoke it within your PL/SQL code to
    place the images appropriately on your HTML page via the PL/SQL toolkit.
    from a html form
    1. Create an HTML form where the image field will be <input type="file">. You also
    need the file MIME type .
    2. Create a procedure receiving the form parameters. The file field will be a Varchar2
    parameter, because you receive the image path not the image itself.
    3. Insert the image file into table using "Create directory NAME as IMAGE_PATH" and
    then use "Insert into TABLE (consecutive, BLOB_OBJECT, MIME_OBJECT) values (sequence.nextval,
    EMPTY_BLOB(), 'GIF' or 'JPEG') returning BLOB_OBJECT, consecutive into variable_blob,
    variable_consecutive.
    4. Load the file into table using:
    dbms_lob.loadfromfile(variable_blob, variable_file_name, dbms_lob.getlength(variable_file_name));
    dbms_lob.fileclose(variable_file_name);
    commit.
    Regards,
    Simma........

  • Inserting Image into a BLOB column in Oracle9i

    Hi,
    I am unable to insert image into a BLOB column. I am using Forms 6i REL 2 and Oracle 9i. But I could do it on Oracle 8i with same Forms version.
    Same thing is true for CLOB in 9i.
    Would you please try with this code?
    TABLE
    Create table x
    (Id number,
    Name CLOB,
    Pict BLOB);
    WHEN-BUTTON-PRESSED trigge
    declare
         x varchar2(265);
    begin
         x := get_file_name;
         read_image_file (x, 'GIF', 'picture.pict');
    end;
    Take care,
    Tarek

    Forms 9i and Oracle 9i work fine together for this case.

  • Displaying the image stored in Blob column

    Hi all,
    I'm trying to print the report with an image. I've stored the image in a Blob column and the format of the image is Jpg.
    I'm using the Reports 10g(10.1.2.0.2). When I'm trying to print the report, I'm getting an error Rep-62203. I want to know whether there are any settings which i need to set to display the image item. I mean to say that are there any registry settings.
    Regards,
    Alok Dubey
    Edited by: Alok Dubey on Dec 1, 2008 12:55 PM

    Hi all,
    I'm trying to print the report with an image. I've stored the image in a Blob column and the format of the image is Jpg.
    I'm using the Reports 10g(10.1.2.0.2). When I'm trying to print the report, I'm getting an error Rep-62203. I want to know whether there are any settings which i need to set to display the image item. I mean to say that are there any registry settings.
    Regards,
    Alok Dubey
    Edited by: Alok Dubey on Dec 1, 2008 12:55 PM

  • How can I insert a image into a BLOB column in a table?

    I am using forms6i against a 10gR2 database and I have one table with a BLOB column and I try to insert a image into this column. I get ORA-01461 error.
    The curious case is that in another table with a BLOB column it works very fine.
    What happens with the first table? How can I avoid the error?
    Thanks in advance.

    Hi hyue,
    Thanks for visiting Apple Support Communities.
    If you would like to add an image to a project in iMovie for iOS, see this article for helpful steps:
    iMovie for iOS (iPad): Add photos to a project
    http://support.apple.com/kb/PH3171
    All the best,
    Jeremy

  • Displaying images stored in blob columns

    I've seen discussions on how to upload and download blob columns but I want to store a blob in the database and be able to display the blob (which is a jpg) as I would any other <img> on my web page. Instead of having to store the jpg on a file system somewhere, and use the data in the database to formulate a link to the image on the file share, I want to pull it right out of the blob. Does someone have a sample of how to do this? Can I do this?
    Thanks

    Laurence,
    If you uploaded the image via the Application Builder, you can use an image tag like so:
    &lt;img src="#WORKSPACE_IMAGES#my_image.jpg" /&gt;If you followed the upload/download how to, you should be able to reference an image like this:
    &lt;img src="download_my_file?p_file=1232897645" /&gt;Where 1232897645 is the unique ID of the uploaded image. To make referencing images easier, you could write a version of the download_my_file procedure that takes in the name of the image as a parameter.
    Sergio

  • Image stored in BLOB column crashes report's engine

    Hi,
    I have a report where I display logos stored in a BLOB column on the DB.
    The report is generated as RTF.
    When images have sizes of 624x168 or 423x324 everything is OK. One image, 1221x224, is crashig the report with a dr. Watson error.
    Any idea why?
    The size of the "bad" image file is 38K, and the "good" ones are about 300K.
    Monica

    Sajjad wrote:
    I altered student table to store photoes of students. For this I added STIMG as blob, MIMETYPE,FILENAME,IMAGE_LAST_UPDATE COLUMNS to studentadmitted table. Image stored and displayed in report very nicely. With the following query
    select "ROWID",
    "ST_ID",
    "FIRST_NAME",
    "LAST_NAME",
    "FFIRST_NAME",
    "FLAST_NAME",
    "COURSE_ID",
    "SESSION_ID",
    "CONTACT#" "CONTACT_H",nvl(dbms_lob.getlength(STIMG),0) IMAGE
    from "#OWNER#"."STUDENTADMITTED"
    Images are displayed in column but they have different sizes.Stick to declarative BLOB images as above. They can be resized in reports using CSS. Add a style sheet in the page Inline CSS property:
    td[headers="IMAGE"] img {
      display: block;
      width: 75px;
      border: 1px solid #999;
      padding: 6px;
      background: #f6f6f6;
    }where the <tt>IMAGE</tt> value in the attribute selector is the table header ID of the image column. Setting only one dimension (in this case the width) scales the image with the correct aspect ratio. (The border, padding and background properties are just eye candy...)
    However, if the original images are large then scaling them in the browser this way is a huge waste of bandwidth and produces poorer quality images than creating proper scaled down versions using image tools. Downloading megapixel images and then reducing them to thumbnail size results in pointlessly pushing millions of bytes that will never be seen.
    For improved performance and image quality, and where you require image-specific scaling the best approach is to use the database ORDImage object to produce thumbnail and preview versions automatically. Note that this is not possible in Oracle XE as Multimedia is not included

  • Download an Image from a blob column

    Jdeveloper 11g R2, ADFbc, JSF
    I have a Product table with a column image (blob data type)
    my app upload and show any image to/from this column
    I want to allow end user to be able to download the image after the image is showed , what should be a good approcuh to do this?
    thank you

    duplicated

  • Conditional Text and Image based on Excel column values

    Hi,
       I have an excel file which contains data that needs to be imported/merged in an InDesign document. I have converted that file into a CSV... I'm unable to figure out how to create document using Data Merge after evaluating some conditions on data ... Example InDesing document layout is like below and will be repeated for say 200 data rows...
    Heading 1
    Text 1, Text 2
    Text 3
    Image
    Heading 1, Text 1 and Text 2 even Image value will be set after checking some condition like below
    if ( column 'A' == ' ' && column 'B' == '1')
      Set 'Heading 1' == column X
    if ( column 'C' == '0' && file.exist(column C & '.jpg'))
       Set 'Image' == column C & '.jpg'
    Can someone please guide me how to create document when CSV and Images are given based on this scenario? and even if Data Merge is the right solution for this.
    -- Thanks.

    Data merge can only reproduce one layout, so you can't merge 200 rows and then change things unless you do it in separate documents and then combine them. Of course anything you can do via scripting or manually on a regular document you can also do to a merged document after the merge is complete.
    It sounds like this is a multiple-records-per-page scenario. TO do that you set up ONE instance only of what you want to merge, in the upper left position on the page. ID then duplicates EVERYTHING that is on the page as many times as will fit using the spacing parameters you provide. This means you need to be careful with frame sizes so they don't extend beyond where they should, but it also means you can add a no-fill, no-stroke frame as a border or bounding box to make it easier to get a precise size to be used by each record. Frames in merged documents are not threaded from record to record (though there are methods for doing that after the merge, if desired), so deleting a record normally leaves a hole in the page.
    If you have master page items, it's probably best to us the "none" master before the merge, then apply the correct master page after.
    Peter

  • Image from database blob column

    Hi all,
    Is it possible to show the image stored in data base column(blob type) in image component without using servlet.? ( I mean in a declarative way.)
    I saw lot of samples which all using servlet. I needed to know whether it is possible to show image in more simple way.
    Thanks,
    Gijith.

    No,  using a servlet is the way to go.
    Timo

  • Displaying Image from ADF BC (BLOB Column) in ADF Mobile Application

    I have made an ADF BC over a database. Now I want to use that ADF BC's data control in my ADF Mobile App to display image stored in a blob column in the database!
    How should I got about it?
    Regards,
    Muhammad Zaheer

    Sir,
    I have exposed it through web services and I'm using the Web Service data control in my mobile application but the blob column is shown as output text in the data control. Now I don't know how to display the image from the blob column in my ADF mobile application.
    Looking forward for your help.
    Thank you.

  • Insert picture in a blob column and show in oracle forms

    hi ,
    please help me with this
    I am trying to insert a picture into a blob column of a table and show that in oracle forms , but not able to do it .
    I am using version 10g for both database and forms .
    Please tell me how to insert a picture in a blob column that is stored in my 'c:\test' folder
    and also how to show that in forms .

    To populate the Image Item you have to use the Webutil Client_Read_Image_File() built-in.
    here
    http://www.oracle.com/webapps/online-help/forms/10g/state?navSetId=_&navId=3&vtTopicFile=f1_help/builtn_r/readimag.html&vtTopicId=
    To add an Image Item to your block based on the table that contains the BLOB column, then give this Image Item the BLOB column name.
    So that, all you have to do is to execute query on that block.

  • Convert image item to blob in memory and pass to procedure - How to?

    Hi,
    I have a form the retrieves an image from the client file system in forms 6i and displays it. Now, I need to pass the image to a stored procedure as a blob. Is there a way to convert an image item to a blob in memory to pass to my procedure?
    Thanks for the help,
    Lee

    I am working on a solution that consists to send an image from a BLOB column to a Java Bean through Forms via the Set_Custom_Property().
    Unfortunately, I encounter a strange problem. 5 characters are bad interpreted, so the final image is totaly ugly.
    I get the chunk of image like this:
    FUNCTION Get_Chunk RETURN VARCHAR2
      IS
        LN$amt  NUMBER := GN$Chunk ;
        LR$raw  RAW(32000);
      BEGIN
        LN$amt := GN$Chunk ;
        -- Read the BLOB
        dbms_lob.READ(GL$Blob, LN$amt, GN$Pos, LR$raw);
        GN$Pos := GN$Pos + LN$amt;
        LN$amt := GN$Chunk;
        RETURN utl_raw.cast_to_varchar2(LR$raw) ;
      EXCEPTION
        WHEN OTHERS THEN
            RETURN NULL ;
      END Get_Chunk ;The chunks are sent to the bean that rebuild the binary image with the getBytes() methods.
    For an unknown reason, 5 characters are misunterpreted:
    129
    141
    143
    144
    157
    Francois

  • Images in Blob Column..

    Hi
    I have a function that retrieves the blob column which has the image data. I cannot view this from Toad and get the value {hugeBLOB} when I query via Toad.
    I used it in a VB.Net app, but I'm unable to reterive the image there also. Can you please suggest how I can retrieve blob column (which has images) into a .jpg format? I need to retreive the images based on the query.
    Thanks for all suggestions.
    ASR

    Hi,
    Your question is not according to Forum. You must post your thread (for immediate response) on Oracle Forum for Dot Net/VB Forum.
    But i'm going to accept your request.
    I've inserted/ saved image in oracle 9i database. And As well i've read/displayed image into Picture Control from Oracle9i database.
    But i've used C# Dot Net (Visual Studio 2005 Professional) as front hand tool.
    Sorry for VB. One thing IMPORTANT:
    I'm going mention code in C# you can Covert into VB Dot Net. Through Online FREE Compiler(www.developerfusion.co.uk/ and click on utilities.)
    --------------------------------Here Below is C# Code ----------------------------------------------------
    Con.Open();
    string myquery = "Select Form_id,Emp_image From Employee where Form_id=2840";
    OracleCommand cmd = new OracleCommand(myquery, con);
    OracleDataReader dr = cmd.ExecuteReader();
    Boolean recordExist = dr.Read();
    if (recordExist)
    //Now displaying Picture.
    MessageBox.Show("Pic is being loaded by C#. Now");
    OracleLob blob = dr.GetOracleLob(1); //Column #, Emp_image
    Byte[] BLOBData = new Byte[blob.Length];
    //Read blob data into byte array
    int i = blob.Read(BLOBData, 0, System.Convert.ToInt32(blob.Length));
    //Get the primitive byte data into in-memory data stream
    MemoryStream stmBLOBData = new MemoryStream(BLOBData);
    //LOADING INTO PICBOX1
    Picbox1.Image = Image.FromStream(stmBLOBData);
    MessageBox.Show("Now i'm reseting it.");
    Picbox1.SizeMode = PictureBoxSizeMode.StretchImage;
    Else
    MessageBox.Show("Reocrd not found against this id.");
    Hopefully it helps you. If it is still difficult to understand don't shy to make query.
    ---

  • 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.

Maybe you are looking for