Display image from a folder by retrieving the filename from Database

I have an af:table that retrieves data from my db.
Each row of data contains a column that its value is a filename for an image.
I have all the images stored in a folder in my project.
How can i display the image in each row based on the filename that was retrieved from the db.
Thank You

Hi,
replace the outputText component of the column with an imageObject and use
#{row.attributeName} // replace attributeName with your column name
as the imageObject value. You may need to prefix the folder name so the names in the database are completed to reference the file structure in your project
Frank

Similar Messages

  • Display image from database with jspSmart

    Hi
    I have successfully uploaded and saved images into oracle(8.1.5) table DATA_TYPE(dtid number, iconname varchar2(30), icon blob). When I try to display a specific icon in my browser, I get "javax.servlet.ServletException: General error" at:
    PreparedStatement pstmt = myConnection.prepareStatement(mySQL);
    My code looks like this:
    imgModifyDataType.jsp
    <%
    ResultSet myResultSet = null;
    Statement myStatement = null;
    Connection myConnection = null;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    myConnection = DriverManager.getConnection("Jdbc:Odbc:Te","te","te");
    String iconName;
    String pDTID = request.getParameter("dtid");
    String mySQL = "Select iconname, icon from data_types where dtid=?";
    PreparedStatement pstmt = myConnection.prepareStatement(mySQL);
    pstmt.setString(1,pDTID);
    myResultSet = pstmt.executeQuery();
    iconName = myResultSet.getString("iconname");
    myUpload.initialize(pageContext);
    myUpload.downloadField(myResultSet,"icon","application/x-msdownload", iconName);
    %>
    I call this JSP from another JSP like this:
    <img src="imgModifyDataType.jsp?dtid=<%=pDTID%>">
    If we cannt display image with the help of another jsp like this then please guide me how to modify the imgModifyDataType.jsp to a servlet because I have never worked in servlets.
    Please help
    Sajid

    I think that it may help you get image from database. I used two jsp page. First one is getphoto.jsp that makes as table based in sql statment and invoke the getimage.jsp this last returns images based on
    the getphoto.jsp PhotoId.
    /** getphoto.jsp source code */
    <%@page import="java.sql.*,oracle.jdbc.*"%>
    <html>
    <head>
    <title>
    jsp1
    </title>
    </head>
    <body bgcolor="#ffffff">
    <table width="781" border="2">
    <tr<<td>
    <td width="83" bgcolor="#C0C0C0"><b>PhotoId</b><td width="450" bgcolor="#C0C0C0"><b>Description</b></td><td width="228" bgcolor="#C0C0C0"><b>Photo Image</b></td>
    <%
    Connection conn = null;
    Statement stmt = null;
    ResultSet rset = null;
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection("jdbc:oracle:thin:@itas:1521:oraITAS","yourDbUserId","yourDbPassword");
    stmt = conn.createStatement();
    rset = stmt.executeQuery("select photo_id,photo_description from photo");
    while (rset.next()) {
         %>
         <tr><td width="83"><%=rset.getObject("photo_id")%></td><td width="450"><%=rset.getObject("photo_description")%></td><td width="228"><img src="getimage.jsp?PhotoId=<%=rset.getObject("photo_id")%>" width="238" height="228"></td></tr>
         <%
    conn.close();
    %>
    </table>
    </body>
    </html>
    /** getimage.jsp source code */
    <%@ page contentType="image/jpeg; chaoResult=iso-8859-1" language="java" import="java.sql.*,java.io.*,java.util.*" errorPage="" %>
    <%
    String strConnString = null;
    Connection oDbConn;
    Statement oStmt;
    ResultSet oResult;
    String strConnection = null;
    String strUserId = "c_erober";
    String strUserPwd = "sybdev99";
    String strDatabase = "oraITAS";
    String strPhotoId;
    strConnString = "jdbc:odbc:" + strDatabase;
    String strSql;
    try {
    strPhotoId = (String) request.getParameter("PhotoId");
    strSql = "select photo_image from photo" + ( (strPhotoId==null) ? " where photo_id = '001'": (" where photo_id = '" + strPhotoId + "'") );
    DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
    oDbConn = DriverManager.getConnection(strConnString,strUserId,strUserPwd);
    response.setContentType("image/jpeg");
    oStmt = oDbConn.createStatement();
    oResult = oStmt.executeQuery(strSql);
    oResult.next();
    byte[] bytearray = new byte[4096];
    int size=0;
    InputStream sImage;
    sImage = oResult.getBinaryStream(1);
    response.reset();
    response.setContentType("image/jpeg");
    response.addHeader("Content-Disposition","filename=getimage.jpeg");
    while((size=sImage.read(bytearray))!= -1 ) {
    response.getOutputStream().write(bytearray,0,size);
    response.flushBuffer();
    sImage.close();
    oDbConn.close();
    } catch (SQLException ex) { ex.getMessage();
    %>

  • Displaying image from database in report

    I need to include a picture (company logo) in numerous reports. This logo will be stored in an MS SQL Image field in a table (this bit I have already sorted out).
    What I'm wondering is, what is the best way to retrieve this image from the database? Do I just include it in the view the report runs off? I'm hesitant to do this, as the view may return back hundreds of records, which means (I think) it will be sending the image along with it hundreds in time.
    In short:
    1) What is the best way to pass an image to a report.
    2) If I include the Image field in a view which returns back hundreds of line, will the image be returned also hundreds of time, causing network congestion/performance issues?
    3) If so (2), is there a way of sending the image only once, no matter how many rows are in the returned view?
    Thanks.

    Hi Shanon,
    We can display the image by making it a local copy on your machine.
    If it is possible to  get the image saved on local copy.
    If we place the image in detail section then it would return one record.
    As the image is from Database, so it would hit the database very time when you refresh the report and place it in Report Header or report fotter.
    So, place your logo as an OLE object in report and would reduce processing time.
    Regards,
    Naveen.

  • Store and Display Image from Database

    Now that MySQL is working (woo hoo!) with JSC, I have a couple of questions for any experts out there...
    1. How would I perform an image or other file upload from a browser?
    2. How would I retrieve and display an image from a db on a jsp page?
    Thanks for any help.

    Craig, I think I have a simpler way to load an image on the page, although for the time being I'm not retrieving from a database, but from the file system. The problem is that I'm not getting the pages to load continuously with new images. At some point it apears that the session gets clogges and can not load new pictures. I'll try to include the page bean code just below. This time I'm not adding the "code" tags because I haven't being successful with that. If you have problems , please, contact me at [email protected].
    The core of the code is in a couple of button_action methods.
    If you need, I can give access to the http server where this is running.
    Luiz
    package untitled;
    import javax.faces.*;
    import com.sun.jsfcl.app.*;
    import javax.faces.component.html.*;
    import com.sun.jsfcl.std.*;
    import javax.faces.component.*;
    import javax.swing.filechooser.*;
    import javax.swing.*;
    import java.io.*;
    * Creator-managed class.
    * Your code should be placed at the end.
    public class Page1 extends AbstractPageBean {
    private HtmlForm form1 = new HtmlForm();
    private FileSystemView filesystem = FileSystemView.getFileSystemView();
    private File path = new File("C:/Documents and Settings/Luiz Costa/My Documents/Creator/Projects/PictureAlbum/build/images/Isadora\'s Wedding");
    private File[] fileslist = filesystem.getFiles(path, false);
    private int counter = 1;
    private int iw = 0;
    private int ih = 0;
    private Integer aiw = new Integer("1");
    private float aar = 0;
    private float ar = 0;
    private ImageIcon ii = null;
    public HtmlForm getForm1() {
    return form1;
    public void setForm1(HtmlForm hf) {
    this.form1 = hf;
    private HtmlGraphicImage image1 = new HtmlGraphicImage();
    public HtmlGraphicImage getImage1() {
    return image1;
    public void setImage1(HtmlGraphicImage hgi) {
    this.image1 = hgi;
    private HtmlCommandButton button1 = new HtmlCommandButton();
    public HtmlCommandButton getButton1() {
    return button1;
    public void setButton1(HtmlCommandButton hcb) {
    this.button1 = hcb;
    private HtmlCommandButton button2 = new HtmlCommandButton();
    public HtmlCommandButton getButton2() {
    return button2;
    public void setButton2(HtmlCommandButton hcb) {
    this.button2 = hcb;
    private HtmlGraphicImage image2 = new HtmlGraphicImage();
    public HtmlGraphicImage getImage2() {
    return image2;
    public void setImage2(HtmlGraphicImage hgi) {
    this.image2 = hgi;
    private HtmlOutputText outputText1 = new HtmlOutputText();
    public HtmlOutputText getOutputText1() {
    return outputText1;
    public void setOutputText1(HtmlOutputText hot) {
    this.outputText1 = hot;
    * This constructor contains Creator-managed initialization code.
    * Your initialization code can be placed at the end,
    * but, this code will be invoked only the first time the page is rendered,
    * and any properties set in the .jsp file will override settings here.
    public Page1() {
    // Creator-managed initialization code
    try {
    catch ( Exception e) {
    log("Page1 Initialization Failure", e);
    throw new FacesException(e);
    // User provided initialization code
    public String button1_action() {
    // Add your event code here...
    outputText1.setValue(fileslist[counter].getAbsoluteFile().getPath()+fileslist.length+"left"+counter);
    ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[counter].getName());
    ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
    // aiw = new Integer(image1.getWidth());
    aiw = new Integer(ii.getIconHeight());
    aar = ar*aiw.intValue();
    image1.setHeight(""+(int)aar);
    outputText1.setValue(image1.getHeight());
    image1.setUrl("images/Isadora\'s Wedding/"+fileslist[counter].getName());
    ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
    ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
    // aiw = new Integer(image2.getWidth());
    aiw = new Integer(ii.getIconHeight());
    aar = ar*aiw.intValue();
    image2.setHeight(""+(int)aar);
    outputText1.setValue(image2.getHeight());
    image2.setUrl("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
    counter = (counter-1+fileslist.length) % fileslist.length;
    return null;
    public String button2_action() {
    // Add your event code here...
    outputText1.setValue(fileslist[counter].getAbsoluteFile().getPath()+fileslist.length+"right"+counter);
    ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[counter].getName());
    ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
    // aiw = new Integer(image1.getWidth());
    aiw = new Integer(ii.getIconHeight());
    aar = ar*aiw.intValue();
    image1.setHeight(""+(int)aar);
    outputText1.setValue(image1.getHeight());
    image1.setUrl("images/Isadora\'s Wedding/"+fileslist[counter].getName());
    ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
    ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
    // aiw = new Integer(image2.getWidth());
    aiw = new Integer(ii.getIconHeight());
    aar = ar*aiw.intValue();
    image2.setHeight(""+(int)aar);
    outputText1.setValue(image2.getHeight());
    image2.setUrl("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
    counter = (counter+1+fileslist.length) % fileslist.length;
    return null;
    }

  • Display Images from Database

    Hi all,
    I require to display images stored in database along with textual description of it on a JSP.
    The image file should not be stored intermediately on file system (i.e w/o using img HTML tag)
    It is a typical shopping cart appln. where images are fetched from database and the associated description is displayed along side.
    Please note that it is the case of Mixed content types(text and binary data).
    Thanks and Regards

    Like "Breakfast" said, you can do this with a servlet that retrieves your images from a database....
    if you create a servlet to do this, you would have a generic servlet which retrieves a picture from a database based upon a key which could be a picture name or number.
    Lets say the file is out there in the database as a BLOB or Binary Image... you could have this kind of code in the doPost(HttpRequest req, HttpResponse res) or doService(HttpRequest req, HttpResponse res) method.
    The table holding the image has at least two columns one called IMAGE which holds the binary image and the other called FILENAME. If the connection to the DB is already open, you do something like this.
    String fileToGet = (String)req.getParameter("FILENAME");
    rs = conn.createStatement().executeQuery("select from IMAGE_TABLE where FILENAME='" + fileToGet + "'");
    if(rs.next())
    InputStream in = rs.getBinaryStream("IMAGE");
    res.setContentType("image/jpg"); // or whatever type of file it is.
    ServletOutputStream sout = res.getOutputStream();
    int c;
    while((c = in.read()) != -1)
    sout.write(c);
    in.close();
    sout.close();
    This should write your image to the response output of the servlet.
    Now, where you want your image, you put.
    <img src="/servlet/ImageServlet?FILENAME="thefileIwant">
    This should do what you want... Use your favorite pipe copy method to get the input stream to the output stream. If you are worried about overhead and scaling like "breakfast" said (it CAN be a problem in high access sites), then you can add an image caching scheme and get really complex.... But this is a rough idea on what to do.
    Hope this helps.
    Stephen McConnell

  • Displaying image from Database with php

    Hello everybody,
    I'm working on a website that displays videos courses and tutorials as my final project
    and I'm working with "Flash builder 4" the database with mySQL and the application server with php
    Basically, the goal is to display a datagrid that shows the manager of the website in column all the information stored on the "Course" table
    the structure of the table is :
    Course (id,img,src,title,description)
    -id : primary key
    -img : path to a photo of course {for example picture of JAVA}
    -src : path to the playlist file {xml file}
    -title : String
    -description : String too
    I already succeeded to display all these contents on a DataGrid, but not with the image, I couldn't display an imageon its column using the path stored on the database, I used a DataRenderer to do that, and here is my code for Renderer and the DataGrid.mxml
    CourseGrid.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:courseservice="services.courseservice.*">
    <fx:Script>
    <![CDATA[
    import Renderers.CourseDeleteRenderer;
    import Renderers.CourseImageRenderer;
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
    getAllCourseResult.token = courseService.getAllCourse();
    ]]>
    </fx:Script>
    <fx:Declarations>
    <s:CallResponder id="getAllCourseResult"/>
    <courseservice:CourseService id="courseService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <mx:DataGrid x="10" y="10" id="dataGrid"
    creationComplete="dataGrid_creationCompleteHandler(event)"
    dataProvider="{getAllCourseResult.lastResult}"
    width="100%">
    <mx:columns>
    <mx:DataGridColumn headerText="" dataField="img" sortable="false" itemRenderer="Renderers.CourseImageRenderer"/>
    <mx:DataGridColumn headerText="id" dataField="id"/>
    <mx:DataGridColumn headerText="src" dataField="src"/>
    <mx:DataGridColumn headerText="title" dataField="title"/>
    <mx:DataGridColumn headerText="description" dataField="description"/>
    <mx:DataGridColumn headerText="Delete" itemRenderer="Renderers.CourseDeleteRenderer"/>
    <mx:DataGridColumn headerText="Update" itemRenderer="Renderers.CourseUpdateRenderer"/>
    </mx:columns>
    </mx:DataGrid>
    </s:Application>
    CourseImageRenderer.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx"
      focusEnabled="true">
    <mx:Image source="{data}" width="60" height="60"/>
    </s:MXDataGridItemRenderer>
    Result :
    Problem :
    How can I access to the path of the image, I tried to write "data.img" instead of "data" as img is the name of the column in the database that stores the path but it wasn't successful.
    I know that it not complete statement "data" because "data" is a reference to what the DataGrid provides of information that gets from the (CreationComplete) event.
    Question :
    - Can you please help me with this so I can complete displaying images by accessing to what is on the column in tha DB so I can manipulate my datas that is stored there ?
    ==> I still have some questions about the buttons to update and delete datas fomr the DataGrid, but, until now I need to access successfully to the photo and display it
    Thank you,

    Anyone that can help me with this ?
    Please, try this with me, I'm asking Flex developpers this might be easy for you !
    It's just question of how to access the string stored in the variable "data", when I used XML I just type the path to the repeated element like this :
    XML file :
    XML File
    <parent>
    <child>
    <repeated_child></repeated_child>
    <repeated_child></repeated_child>
    <repeated_child></repeated_child>
    </child>
    </parent>
    I used a Model as a reference to the xml file
    and an arrayList as a container of the repeated child
    I just write in the code "data.parent.repeated_child" to access the text in the "repeated_child"
    and here is the code, that I implemented to generate videos from xml file to display a video play list
    Video Playlist code(extract from XML file "data.xml")
    <fx:Declarations>
    <fx:Model id="model" source="assets/data.xml"/>
    <s:ArrayList id="products" source="{model.video}"/>
    </fx:Declarations>
    <mx:List  dataProvider="{products}" labelField="title"
      change="list1_changeHandler(event,List(event.currentTarget).selectedItem)" x="103" y="77" height="350" width="198"/>
    That was my goal to do that with the database.
    Please help me
    If you have other solution I still need it.
    Thank you,

  • ADF: Display image from database

    Hi,
    I've found a number of threads addressing this issue, but none that have solved my problem as yet. I'm trying to display an image from a database column in JDev 10.1.3.2.0. I've found an article in the Help that sounds like it's describing exactly what I need:
    To insert a databound image control into a form or panel: In the ADF Swing project, open the Java Visual Editor on the desired data panel or form. From the View menu choose Data Control Palette to open the palette. In the Data Control Palette, drag the attribute you want to bind to the image control into the open form or panel. From the Add Child popup list, select JUImageControl. JDeveloper adds code to the class file to bind the JUImageControl to the attribute
    The problem I'm having is that this doesn't bear any relation to what I can see. I'm presuming that the Java Visual Editor is the design tab of the jsp page editor, as this is the only visual editor I can find. If it isn't, that would explain why this doesn't work... When I drag my attribute, I have to select what type of item I want it to be. I can't find an Add Child popup anywhere.
    I have a horrible feeling that this is a very stupid question, but I'm completely stuck.

    The help-text you found refers to an ADF-Swing project, not a web application with JSP's. This post: How to display the content of a BLOB column in a ADF/BC pages ? shows you how to do it with ADF Faces.

  • Displaying image from database table.

    Hi All,
       I am very new to Web Dynpro ABAP.
      I am developing an application to display an image in "Image" UI Element.
      For this I have one table consisting of fields image id, image data and image name. here image id is primary key field.
    Now i want to display an image from that table in "Image" UI Element. For this i am using "Filedown load" UI element.
    But by using filedownload ui element i can diaplay image in another new page.
    But my requirement is to display image in the same web page without creating a new one.
    (I want to display the image in "Image" UI element without storing that image in MIME objects.)
    Can anyone help me.
    Thanks in Advance!
    Regards,
    Sreelakshmi.

    What you describe is completely possible.  Since you have the image data (XSTRING) in the context you have everything you need.  You don't need to store the content into the MIME Repository, but you do need to get it somewhere where it has an externally accessible URL.  Remember you need to supply image UI element with a URL.  This URL is processed on the client side by the web browser.  Therefore just giving it a path to the context won't work as that isn't externally accessible.
    I would suggest instead that you place the image content into the ICM cache temporarily.  This lets you basically generate a temporary URL for the image that can be used by the Image UI element. 
    Here is some example code that pushes images into the ICM Cache:
    ****Create the cached response object that we will insert our content into
      DATA: cached_response TYPE REF TO if_http_response.
      CREATE OBJECT cached_response
        TYPE
          cl_http_response
        EXPORTING
          add_c_msg        = 1.
       try. " ignore, if compression can not be switched on
          call method cached_response->set_compression
            exporting
              options = cached_response->co_compress_based_on_mime_type
            exceptions
              others  = 1.
        catch cx_root.
      endtry.
    ****set the data and the headers
      DATA: l_app_type TYPE string.
      DATA: l_xstring TYPE xstring.
          cached_response->set_data( me->gx_content ).
          l_app_type = me->gx_mimetype
      cached_response->set_header_field( name  = if_http_header_fields=>content_type
                                         value = l_app_type ).
    ****Set the Response Status
      cached_response->set_status( code = 200 reason = 'OK' ).
    ****Set the Cache Timeout - 60 seconds - we only need this in the cache
    ****long enough to build the page and allow the Image on the Client to request it.
      cached_response->server_cache_expire_rel( expires_rel = I_CACHE_TIMEOUT ).
    ****Create a unique URL for the object
      DATA: guid TYPE guid_32.
      CALL FUNCTION 'GUID_CREATE'
        IMPORTING
          ev_guid_32 = guid.
      CONCATENATE i_path '/' guid '.' i_format INTO r_url.
    ****Cache the URL
      cl_http_server=>server_cache_upload( url      = r_url
                                           response = cached_response ).

  • Displaying images from database

    Hi,
    I am creating a real estate site, and I need a thumbnail and full size image to display. I'd like to store the images in respective folders under the Images folder on the server, and store the file name in the database. I can't get the images to display no matter how much I play with the code.
    img src="" />
    The above is the code I've been trying to use to pull the image. I think the problem is I have no file path defined:
    img src="http://website.com/images/main/" />
    but I don't know how to complete the path so the correct image shows based on ID.
    Any help would be greatly appreciated.

    You have already found the problem, so you simply need to get the paths correct. Since this depends on where you store the images, you need to find the direct URL to the image:
    http://website.com/images/main/some_image.jpg
    and ensure that your generated code works.

  • Displaying image from database

    Hello. I have this problem if anyone can help. I have an image inserted into a MySQL database. But when I try to display it using JSP I get a screen full of funny characters and do not display. The code I use is below.
    String sql2 = "Select image1 from images";
    ResultSet rs2 = stmt.executeQuery(sql2);
    if(rs2.next())
    InputStream in = rs2.getBinaryStream("image1");
    response.setContentType("image/jpg");
    ServletOutputStream sout = response.getOutputStream();
    int c;
    while((c = in.read()) != -1)
    sout.write(c);
    in.close();
    sout.close();
    I tried using the code below, but that don't work either.
    %>
    <tr>
    <td><img src="<%= rs2.getString("image2") %>"></td>
    </tr>
    <%
    What am I doing wrong here? Is it better to grab the image straight out of a directory? If so, how? The image would be on the Tomcat4 server in the root directory.

    When a html page is downloaded to the client, each image, css include, *.js include etc.. are fetch one at a time. So you would want to write a servlet that is mapped to something like /database/image/name.jpg and this servlet would be responible for pulling the image from the database, setting the proper MIME type and writing it to the client.
    In your case, you are writing the image content to the client within the jsp page. This explains the char's you see within the page.
    Things you should do:
    Create custom servlet which will pull the images from the database.
    map the servlet to what ever patteren you like. (web.xml file you would edit)
    Set the mime type and write the image.
    I hope this is of help.

  • Problems display image from database

    I have set up an image upload page which allows the user to browse for a photograph and save the path of the photograph to the database.
    Unfortunately I can't figure out how to display the picture.
    I use an SQL $Get which retrieves the path correctly, but the image still does not display.
    I've tried 2 methods:
         imagejpeg($row_Get['PictureLocation'])
         This returns an error ...... imagejpeg() expects parameter  1 to be a resource.
    2nd method.
         Insert image then datasources.
         This doesn't do anaything in the browser, but curiosly displays a question marked box in live view.
    Any suggestions?

    I wrote an article about this recently. It's in the Dreamweaver Cookbook: http://cookbooks.adobe.com/post_Display_an_image_stored_in_a_database__PHP_-16637.html.

  • How to retrieve and display image from database in a web page

    Hi all;
    I have been trying this for some time now. I have found some tutorials so far but none of them addresses my concern. Here it is:
    I have built a web application that can connect to an Oracle DB.
    I have a table called "employee", where I record any employee details, among which the employee picture. I stored the pictures and the finger prints using "Oracle sql developper" as blob type.
    How can i retrieve and view all these information when i run the application?
    I can easily retrieve all other types of value, but the image(BLOB type) has been a nightmare for me.
    HELP PLEASE.

    morgalr wrote:
    I believe your Binary Large Obejct will come back as an array of int, and you'll need to use BufferedImage it's associated API to get it to a viewable image configuration.I don't think BufferedImage immediately solves the problem -- this is a web app, so I assume the image will be displayed using the HTML IMG tag.
    Solution: google. There are many example of how to do this. For example, any book on servlets will have an example of dishing up a dynamic image.

  • Alternative ways of displaying image from database?

    hi - I'm working with some legacy/inherited/already-written Forms that just use block triggers to 'select values into :Fields..' to populate the text boxes on the canvas.
    Whenever I've managed to display db-based images before, it's always been on blocks that are based just on the table, and Forms shows the image okay.
    These forms I'm using at the moment though aren't based on tables, they just get populated from the trigger.
    I don't believe you can select into a blob/image, or at least I haven't been able to get that to work.
    Are there any alternative ways of populating an image place-holder, with a blob field from the database? (other than using a table-based block)??
    thanks.

    May be you can separate the image item to a DB block with primary key of the table and create a relation between two blocks. So when the first block is populated through trigger, it would fetch the image on 2nd block automatically.

  • Problem to display image from database

    i also waiting when this practical will come to the end la..really boring..mrhanafi came 2 weeks ago..he didnt check anyhting..he was there for 15 mins only..hey dont play ponteng la..after this friday you ponteng how many days you want;)

    Using JHeadstart, you can display a BLOB column from the database in HTML, by way of ADF. Check out the JHeadstart Tutorial at http://www.oracle.com/technology/products/jdev/tips/muench/jhstutorial/index.html to get started, then do the same for your own database tables that include the BLOB column. JHeadstart will take care of rendering it as a file upload or image, depending on the display type you set at the attribute level.
    Hope this helps,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting

  • Display Image from database to JLabel component

    Am developig an application and i have successfully read and shown textual data in a JInternalFrame, the only issue is to display the photo in a JLabel. Am able to save the details and photo into the database.
    What do i need to do to show the photo? Please assist me

    check this
    http://forum.java.sun.com/thread.jspa?threadID=722827&messageID=4357861

Maybe you are looking for

  • Ipod touch not recognized in itunes windows

    Windows will not recognize my ipod touch. I have gone throught the Apple troubleshooting procedures and no luck.

  • Map a custom SRM field to a standard field in R/3

    Hello All, We have created a custom field in SRM and it needs to be transferred to one of R/3's standard field. it has to be done in both the classic and extended classic scenario. For the extended classic scenario I tried using the BADI BBP_ECS_PO_O

  • Receiver Determination and Interface Determination Condition conflict in ICO

    Hi, I found a strange issue today while configuring two receivers using the Receiver and Interface Determination conditions. Sender - Proxy Service Receiver1 - ReceiverA Receiver2 - ReceiverB Receiver Determination Condition : When Field1 = 100, mess

  • Assertions in java

    i m confused by the call by value property of java.those it sends an object it treats it as call by value.so what actually happens in terms of memory wise when an object is passed to a function.this quite a puzzed question to me and i ll be thank ful

  • Problem opening Illustrator files from Bridge

    I recently installed cs5.5 and can no longer open my Illustrator files from within Bridge.  When I double click on the file in Bridge, it switches to Illustrator and the hour glass appears for about 5-10 seconds before switching back to the selector