How to display an image from database

Hi all,
I've saved an image(jpeg file) as BLOB item in the database through the forms.I need to fetch that particular image from the database and display the image in the report.How can i do that?
I tried to fetch the column from the database and added a text item and selected the PHOTO column , the properties has changed once i selected the BLOB item.File format I changed to Image , But the width is 4 and I'm not able to change that.
While executing I'm getting two errors,
REP : 0069 Internal Error
REP : 62203 Internal Error reading the image - Unable to render RenderedOp for this operation
Please help me to solve this issue.
Thanks in advance...

Hello,
Try to revert to the "old" way to render images :
http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/envvars/envvar_reports_default_display.htm
To revert to the dependency on DISPLAY and use screen fonts (old font look up algorithm):
Set REPORTS_DEFAULT_DISPLAY=NO.
Remove the screenprinter.ppd entry in the uiscreenprint.txt file.
Set the DISPLAY variable to the active X-Windows display surface.
Regards

Similar Messages

  • How to display multiple tables from database using netbeans swing gui

    plz reply asap on how to display multiple tables from database using netbeans swing gui into the same project

    Layered Pane with JTables or you can easily to it with a little scripting and HTML.
    plzzzzzzzzzzzzzzzzz, do not use SMS speak when posting.

  • How to display the data from database(MS access) to a textbox

    anyone know ?

    how to display the data from database(MS access) to a
    textboxThe reply hasn't changed over these years. Read the tuutorial on how to fetch the data. You can display it anywhere you feel like. :)
    http://java.sun.com/docs/books/tutorial/jdbc/

  • How to retrive multiple images from database

    Hi,
    I have to retrieve multiple images from oracle database and have to display the image in the jsp.
    I am passing imageCategoryId from the jsp.This id contain number of image in DB.
    I googled the issue and i found some solution.want to know whether what i did is correct and how i have to display the retrieved image in jsp.
    Need urgent help.Experts kindly help me.
    This is my action file.
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.naming.NamingException;
    import com.image.dao.ImageDAO;
    public class GetImageServlet extends HttpServlet{
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException{
    try{
         ImageDAO image = new ImageDAO();
    String categoryId = request.getParameter("catgId");
         bytes[] imagebyte = image.getImagesByCategoryId(categoryId);
    InputStream is = new FileInputStream(imagebyte);
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    bos.write(imagebyte);
    blobIs.close();
    catch(IOException e){
    e.printStackTrace();
    } catch(Exception excep) {
                        excep.printStackTrace();
    This is DAO file
    public byte[] getImagesByCategoryId(String categoryId) throws Exception
              PreparedStatement statement = null;
              ResultSet resultSet = null;
              StringBuffer queryBuffer = new StringBuffer();
              Blob image = null;
              String imageId = null;
              ArrayList imageIdLIst = new ArrayList();
              try {
                   this.connection = connManager.getDataSourceConnection();
                   queryBuffer.append("select image from Image_Table where image_category='"+categoryId+"'");
                   statement = connection.prepareStatement(queryBuffer.toString());
                   resultSet = statement.executeQuery();
                   while(resultSet.next()) {
                        image = rs.getBlob(1);
                        long imgLength = image.getBufferSize();
                        byte[] byteImage = new byte[imgLength];
                        byteImage = image.getBytes(1,(int)imgLength);
              } catch(Exception excep) {
                   excep.printStackTrace();
              return byteImage;
    How to display retrieved image in jsp.
    whether action and dao file is correct or what changes i have to do to correct the problem.
    P.S : As a Newbie i dont know how to use code tag for this java code.Kindly forgive me.
    Regards,
    hardlyUsed.

    hardlyused wrote:
    I have to retrieve multiple images from oracle database and have to display the image in the jsp.There are at least two parts to the problem.
    1. Get it from the database.
    2. Display it.
    Part 1 has nothing to do with part 2.
    You must solve 1 before you solve 2.
    Finally generically there is no such thing an "image" but rather there is binary data which is represented in such a way that it one of many formats that represent an "image".
    Knowing which specific format the "image" is stored in will at a minimum be helpful and could be required.

  • How to retrieve am image from database

    hi ,
    i hav a requirement that, i hav to store and retrive an image from database(postgresql)and palce it on JLabel.i successfully stored an image into database .while retrieving an image from database im not getting the image .please any one can help me how to retrieve an image and place it in JLabel.
    This the code for inserting an image:
    Class.forName("org.postgresql.Driver");
    Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:port/database", "username", "pwd");
    System.out.println("Connection established");
    String INSERT_PICTURE = "insert into imagedata(imageid,data) values (?, ?)";
    FileInputStream fis = null;
    PreparedStatement ps = null;
    try {
    conn.setAutoCommit(false);
    File file = new File("photo.jpg");
    fis = new FileInputStream(file);
    ps = conn.prepareStatement(INSERT_PICTURE);
    ps.setInt(1, 2);
    ps.setBinaryStream(2, fis, (int) file.length());
    ps.executeUpdate();
    conn.commit();
    catch(Exception ex)
    ex.printStackTrace();
    finally {
    ps.close();
    fis.close();This is the code for retrieve an image :
    Class.forName("org.postgresql.Driver");
    Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:port/database", "username", "pwd");
    byte[] imgbytes = null;
    String INSERT_PICTURE = "select imageid,data from imagedata ";
    Statement stmt=(Statement) conn.createStatement();
    try {
    ResultSet rs=stmt.executeQuery(INSERT_PICTURE);
    while(rs.next())
    System.out.println(rs.getString(1));
    InputStream file=rs.getBinaryStream(2);
    System.out.println("FILE : "+file);
    catch(SQLException a)
    finally {
    stmt.close();please anyone can help meee
    thanks

    You basically save a File to the database, so you can just re-write the data from the file back temporarily and load it into the application using the ImageIO class
    // create necessary connection and statement objects
    // retrieve image column
    ResultSet rs = stmt.executeQuery("SELECT Image FROM dataTable");
    rs.next();
    Blob imageData = rs.getBlob("Image");
    if( imageData != null ) {
        try {
            File tmpFile = new File("tmpImage");
            FileOutputStream fos = new FileOutputStream(tmpFile);
                fos.write( imageData.getBytes(1L, (int)imageData.length()) );
                fos.close();
            tmpFile.deleteOnExit();
            ImageIcon icon = new ImageIcon( ImageIO.read(tmpFile) );   
            JOptionPane.showMessageDialog(null, icon);
        } catch(IOException ioe) {
            ioe.printStackTrace();
            JOptionPane.showMessageDialog(null, "Failed To Load Image Data", "Load Error",
                    JOptionPane.ERROR_MESSAGE);
    }ICE

  • Can i display all images from databases with adf jsp

    hi
    I want to display all images from the databases whit adf bussines components, because with the sample on http://www.oracle.com/technology/training/products/intermedia/index.html page, i only can display 10 images. i'd lije to know if i can to search in the databases by the id of the image.
    this is the code:
    %@ taglib uri="http://xmlns.oracle.com/adf/ui/jsp/adftags" prefix="adf"%>
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>untitled</title>
    </head>
    <body>
    <html:errors/>
    <table border="1" width="100%">
    <tr>
    <th> </th>
    <th>
    <c:out value="${bindings.ImagenView1.labels['Id']}"/>
    </th>
    <th>
    <c:out value="${bindings.ImagenView1.labels['Descripcion']}"/>
    </th>
    <th>
    <c:out value="${bindings.ImagenView1.labels['Image']}"/>
    </th>
    </tr>
    <c:forEach var="Row" items="${bindings.ImagenView1.rangeSet}">
    <tr>
    <td>
    <c:out value="${Row.currencyString}"/>
    </td>
    <td>
    <c:out value="${Row['Id']}"/> 
    </td>
    <td>
    <adf:render model="Row.Image"/>
    </td>
    <td>
    <c:out value="${Row['Image']}"/> 
    </td>
    </tr>
    </c:forEach>
    </table>
    </body>
    </html>

    I think you want the interMedia JSP tag library...
    http://www.oracle.com/technology/software/products/intermedia/htdocs/descriptions/tag_library.html
    Larry

  • [Forum FAQ] How to display an image from Http response in Reporting Services?

    Question:
    There is a kind of scenario that users want to display an image which is from URL. In Reporting Services, if the URL points to an image file, we can directly display it by typing the URL in embedded image. However, some URLs are just sending Http requests
    to server side, then redirect to another position and the server will return the image. For these kind of URLs, Reporting Services can’t directly render the image from Http response.
    Answer:
    To achieve this goal, we can add custom code into the report. Pass the URL as argument into our custom function so that we can create HttpRequest and get the HttpResponse. Then we can use custom function to return the Bytes() from the HttpResponse and render
    it into an image in report.
    Ps: In Reporting Services, it only support drawing Bytes() array into image, so we need to have our custom function return Bytes array.
    Add the assembly and custom code into the report.
    Public shared Function GetImageFromByte(Byval URL as String) As byte() 
                    Dim photo as System.Drawing.Image 
             Dim Request As System.Net.HttpWebRequest 
           Dim Response As System.Net.HttpWebResponse 
                  Request = System.Net.WebRequest.Create(URL)         
                     Response = CType(Request.GetResponse, System.Net.WebResponse) 
                 If Request.HaveResponse Then  
                      If Response.StatusCode = Net.HttpStatusCode.OK Then                    
                           photo = System.Drawing.Image.FromStream(Response.GetResponseStream) 
                     End If 
                 End If 
                  Dim ms AS System.IO.MemoryStream = new System.IO.MemoryStream() 
                 photo.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg) 
                    Dim imagedata as byte()  
                    imagedata = ms.GetBuffer()  
                    return imagedata
    End Function
    Grant the permission for assemblies. 
    Go to: 
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\RSpreviewPolicy.config 
    C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\rssrvpolicy.config
    Give “FullTrust” for Report_Expressions_Default_Permissions.
    Insert an image into report. 
    Expression:
    =Code.GetImageFromByte("https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSrVwPoAtlcA2A3KaiAJi-XjS4icr1QUnKYr7uzpX3IL3g2GPisAQ")
    The Result looks below:
    Applies to:
    Reporting Services 2005
    Reporting Services 2008
    Reporting Services 2008 R2
    Reporting Services 2012
    Reporting Services 2014
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    >
    Hi, I'd like to display a dynamic image from the web inside a JLabel or any other swing component it could work in. I've been looking on the Swing tutorials and others forums, all I can have is that a JLabel can load an Icon object, defined by an image URL, but can this URL be like "http://xxxxx/image.jpg" somehow or can it only be a local image URL?>
    I do not know why you start talking about an image on the web then go on to show concerns about whether it will work for a 'local' URL.
    But perhaps this answer will cover the possibilities.
    So long as you can from an URL to the image, and the bytes are available for download (e.g. some web sites wrap a direct call to an image in HTML that embeds the image), the URL based icon constructors will successfully load it.
    It does not matter if that URL points to
    - a web site,
    - a local server ('localhost'),
    - an URL representation of a File on the local file system, or
    - it is inside a Jar file that is on the application's run-time classpath.
    How you go about forming a valid URL to a 'local resources' (or indeed what you regard as local resources) is another matter, depending on the form of the project, and how the resources are stored (see list above).
    Probably the main reason that examples use images at a hard coded URL on the net is that it makes an 'image example' self contained. As soon as we compile and run it, we can see the result. I have posted a few examples like that on these forums.
    Edit 1:
    BTW - Welcome to the Sun forums
    Edited by: AndrewThompson64 on Apr 21, 2009 12:15 PM

  • How to insert, select image from database

    can any one help me to store and retrive image from mySQL database....
    plz can any one send me code for this ?
    thank you

    First of all, I suggest not to do this!! Creates to much overhead on your database. Especially if you have large images that your going to put in the database.
    Otherwise what you could do is create a BLOB that contains the bytes to your image and insert that into your database.

  • How to Display a image from WebCam in the Forms 10.1.2.0.2!

    Hi Friends!
    I'm using a Forms 10.1.2.0.2 and i need to display of someway a image from webcam in some item inside the Forms!
    This is possible?
    I saw an explanation in http://www.orafaq.com/forum/t/89431/67467/ but it works only for a Forms 6.0!
    Somebody can Help me?

    As Jan mentioned, there is no way to display webcam video in Forms unless you create a Java Bean which can be incorporated into your form. As Pauli mentioned, if your webcam software is viewable via a browser, you can use WEB.SHOW_DOCUMENT to display a browser window with the content, however you will not be able to put this content in the form using the method.
    A good starting place would be Google. Look for a java bean or applet which can operate a web cam.
    http://www.google.com/search?q=java+applet+web+cam

  • How to display BLOB images from the Oracle database within Crystal

    Let's say a have the following table
    IMAGES
    ========
    DOC_ID NUMBER
    DOC_NAME STRING
    DOC_IMAGE BLOB
    The BLOB field can have any type of document: PDF, email, WORD, EXcel, etc. I would like to present the DOC_ID and DOC_NAME and let the user click any of them. Once the user clicks the document stored in the database as BLOB, it is rendered using the default application associated to the extension. For example if the file name is ABC.XLS open MSExcel if the file is abc.pdf open Acrobat.
    I am using Crystal2008 and evaluating Crystal 4.0
    Does this requires programming?
    Thanks!!!

    Hi
    Crystal is a reporting tool and you canu2019t execute any code except free hand SQL.  When you pull any BLOB fields in crystal, it takes as a picture field and if that field contains image only it will display in your report.
    If you have any information other than image, it will not display any info in the report.
    If you want to insert Word , PDF and Excel then you will have to insert as ole object and can manage with location of the files.
    Thanks,
    Sastry

  • How can we load images from database to macromedia flash?

    Dear All,
    Actually I'm creating a intractive CD with images(Catalogue)
    loaded in access db. I don't want every user to install the program
    into his pc. When he/she inserts cd it should play and display
    images by category wise (9 pictures at one time). is there flash or
    vb code to acheive this in flash or any flash sample projects
    highly appreciated.
    Thanks a lot

    Hello
    You should look into the option of Retraction from BW to ECC. You may find a lot of docs on the same. Refer the below link for the same
    https://scn.sap.com/thread/1008067
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90cd1106-21b4-2d10-0695-9b1e076191eb?QuickLink=index&overridelayout=true
    Regards
    Gajesh

  • How to load a image from database to image item in oracle 10 g form

    I have stored some images in the Database Table with BLOB datatype. Now I need to load that image in the non database image item. Please advise. Thanks.

    You need to have a print server installed to generate the pdf. Either use BI Publisher and it's desktop development tool or use FOP/Cocoon.. Adding an image with them is a little more involved..
    Thank you,
    Tony Miller
    Webster, TX
    While it is true that technology waits for no man; stupidity will always stop to take on new passengers.

  • How to get all images from folder in c#?

    I am trying to get all images from folder. But it is not executing from following:
     string path=@"C:\wamp\www\fileupload\user_data";
                string[] filePaths = Directory.GetFiles(path,".jpg");
                for (int i = 0; i < filePaths.Length; i++)
                    dataGridImage.Controls.Add(filePaths[i]);
    Please give me the correct solution.

    How to display all images from folder in picturebox in c#?
    private void Form1_Load(object sender, EventArgs e)
    string[] files = Directory.GetFiles(Form1.programdir + "\\card_images", "*", SearchOption.TopDirectoryOnly);
    foreach (var filename in files)
    Bitmap bmp = null;
    try
    bmp = new Bitmap(filename);
    catch (Exception e)
    // remove this if you don't want to see the exception message
    MessageBox.Show(e.Message);
    continue;
    var card = new PictureBox();
    card.BackgroundImage = bmp;
    card.Padding = new Padding(0);
    card.BackgroundImageLayout = ImageLayout.Stretch;
    card.MouseDown += new MouseEventHandler(card_click);
    card.Size = new Size((int)(this.ClientSize.Width / 2) - 15, images.Height);
    images.Controls.Add(card);
    Free .NET Barcode Generator & Scanner supporting over 40 kinds of 1D & 2D symbologies.

  • Retrieving image from database in form 6i

    hello all
    i'm working on form 6i...
    i have uploded images into the database of customers in my application using READ_IMAGE_FILE.. IT IS FINE...
    But when i am trying retrieves records into the form.... i'm getting all the data except image... Image field is showing empty..
    How can i get image from database to form
    can u plz help me.....
    thanks

    What data type you used for storing image in database. If it is long raw, then you can place an image item within your data block on form and associate it with the column name. This should populate the image by itself.
    Below para is from Forms Help.
    Image items can be populated in the following ways:
    +1. a fetch from a LONG RAW database column+
    An image item in a data block is populated automatically when the end user or the application executes a query in the block.  When a fetched image is modified or replaced, Form Builder marks that record as Changed, and the next commit operation saves the new image to the corresponding LONG RAW column in the database.
    Note:  You cannot write a SELECT statement to select a LONG RAW value INTO an image item.
    +2. executing the READ_IMAGE_FILE built-in to read an image from the file system+
    +(To dynamically write an image from an image item out to a file, use the built-in procedure WRITE_IMAGE_FILE.)+

  • How to place an image in database and how to retrieve and display it in the front end

    how to place an image in database and how to retrieve and display it in the front end
    and to place an image in database and retrieve the image from database using xml
    please,help me out.

    Create a table with a Long RAW Datatype column for storing the Image Column Data.
    Create the form based on the table , which by defaults the column with LONG RAW atatype to a Image Item.
    You can use Forms Built in function READ_IMAGE_FILE to read a Image file stored on the file system in to the image item.
    A save on the form saves the image in the Image item in the long raw column.

Maybe you are looking for