Retrieve BLOB image in J-developer 10

Hello,
Well I were surfing the web about this question. Actually I need to retrieve a images that are stored in BLOB's from a database, for example, in database I have a customer, which have 5 images attached in BLOBs,
I found some info, which tells, how to retrieve images using storefront_techpreview3 servlet, but I am not good at understanding the code. As I am beginer in JAVA.
So maybe someone knows a nice tutorial about how to retrieve a display images from database BLOB's in JSP, or maybe some hint's?
Thanks in advance

Well I tried to change some things, but it still don't work.
Here are contents of 3 files
index.html (located under root directory j-developer under UserInterface)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1257"></meta>
<title>index</title>
</head>
<body>
test
<img src='showImage' alt="bilde">
</body>
</html>
web.xml (located in WEB-INF)
<?xml version = '1.0' encoding = 'windows-1257'?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
<description>Empty web.xml file for Web Application</description>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>showImage</servlet-name>
<servlet-class>foto.showImage</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>showImage</servlet-name>
<url-pattern>/showimage</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>35</session-timeout>
</session-config>
<mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
<extension>txt</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>
</web-app>
showImage.java (located under Application Sources, package foto)
package foto;
import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
public class showImage extends HttpServlet {
private Connection con;
private Statement stmt;
private String trace;
* Setup database connection and create SQL statement
public void init( ServletConfig config ) throws ServletException
// Try database connection
try{
// The call to Class.forName explicitly loads the driver class
//Class.forName("org.gjt.mm.mysql.Driver");
//Class.forName("com.orcl.jdbc.Driver").newInstance();
Class.forName("oracle.jdbc.driver.OracleConnection").newInstance();
// Class.forName("com.mysql.jdbc.Driver").newInstance();
//jdbc:mysql://<HOST>:<PORT>/<DB>
//Connection con = DriverManager.getConnection("jdbc:mysql://localhost/mydb?user=''&password=''");
// Connection con;
//con = DriverManager.getConnection("jdbc:oracle://localhost:1521/orcl?user='system'&password='admin'");
con = DriverManager.getConnection("jdbc:oracle:thin:@hp:1521:orcl", "system", "parole");
// Once a connection has been established we can create an instance
// of Statement, through which we will send queries to the database.
stmt = con.createStatement();
catch (Exception exception ) {
exception.printStackTrace();
throw new UnavailableException(exception.getMessage());
} // End init()
* Forward to doGet
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
doPost(request, response);
* NOTE: doPost -> HTTP post requests | doGet -> HTTP get resuest
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
// Simple trace variable for debugging...
trace = "";
SELECT *
FROM image
WHERE image.image_id = ?variable?
try {
String SQL =
"SELECT * " +
"FROM foto " +
"WHERE foto.id = 2";
ResultSet rs = stmt.executeQuery(SQL);
rs.next();
Blob blob = null;
blob = rs.getBlob("foto_blob");
response.setContentType("image/jpeg");
System.out.println("just above OutputStream");
InputStream in = blob.getBinaryStream();
OutputStream out = response.getOutputStream();
int b;
while ((b = in.read()) != -1) {
out.write(b);
in.close();
out.flush();
out.close();
catch (Exception exception ) {
throw new ServletException("Error");
} // end doPost()
* Close SQL statements & database connection
public void destroy()
// Attempt to close statements and database connection
try{
stmt.close();
con.close();
// Handle database exceptions by returning error to client
catch (SQLException sqlException){
sqlException.printStackTrace();
} // End destroy()
} // End class showImage
When I try to run a index.html page I just get an alt atribute content of image tag and when I press link: I get error msg:
404 Not Found
Resource /fotokoki-UserInterface-context-root/showImage not found on this server
Maybe someone notice some mistake? Thank you and forgive me if the question are silly.

Similar Messages

  • Problem with BLOB image retrieval

    We are on Coldfusion 9,0,1,274733. I checked on "Enable binary large object retrieval (BLOB)" on the database but the image is still cut off (3/4 partly grey). On our dev server it works perfectly, our production server just gives off the partly grey images. I checked the CF database settings between dev and production and they are exactly the same. We restarted the server but still the same problem. It is like Coldfusion doesn't see the setting changes. Anyone else has this problem?

    We found the solution. Our production servers are in a clustered environment. You have to enable "Enable binary large object retrieval (BLOB)" at the instance cluster level. You will have to do this change on all the instances in the cluster. I was only enabling it at the "local" level on each server in the cluster (which didn't work).
    In CF Admin:
    Enterprise Manager > Instance Manager > select the instance and enable BLOB

  • Retrieval of image (Blob) from database - doesn't always work in JSP - Why?

    In my JSP pages, when an image needs to be retrieved, I direct <img src> to a servlet that handles image processing.
    As an example, if I have 30 products that need to be shown on 1 webpage, there will be 30, dynamically generated, <img src="go.imageServlet?id=a1"> tags/statements. The servlet, when called, will make a connection to the database, run a query for the image requested (fetched as type Blob), image displays in <img src> area of JSP page, and finally the ResultSet, Statement, and Connection object(s) are closed.
    I tested this out, and unfortunately, to my surprise, and disappointment, a few images did not display on the page. Though the images are in the database table. I'm a little lost as to why this problem is occurring.
    Can someone please shed some light on this for me?

    evnafets wrote:
    If you request just one image, does that image come back broken, or is it different images that are 'broken' each time?On a page of almost 30 image requests (thumbnail size), it varies, but typically, 1-3 images are 'broken' each time. And they are not always the same images. Very strange.
    There may potentially be thread concurrency errors depending upon how you have written your servlet - ie one request for an image interfering with another because they use the same variable.
    To make it threadsafe, in your servlet make sure that you only use variables local to the doGet/doPost method, and not any class attributes.In my JSP page that makes the requests for these images, a String array generates the <img src> tags on the page, as a very basic example :
    <%  for(int i=0; i<products.length; i++) {
    %>
          <img src="go.imageP?imageNumber=<%=products[[0]%>">
    <% }//for %>
    Sorry for not posting code snippets from my servlet in my first post of this topic....
    Here is my servlet snippet -     public class ImageProcessingServlet extends HttpServlet {
              public Connection conn = null;
              public ResultSet rs = null;
              public Statement stmt = null;
              public PreparedStatement pstmt = null;          
              public PrintWriter out = null;     
              public String siteNameReference = "";
              int maxFullSizeImageWidth = 600;          
              int maxSizeImageWidth = 300;
              int maxSizeThumbWidth = 140;
              int maxImageFields = 4;
              String errorMessage = "";               
              public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
                   doPost(req,res);
              public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
              try {                       
         HttpSession session = req.getSession();
         siteNameReference = req.getParameter("snr");
         String process = req.getParameter("process");
         if(process == null) process = "";
                   Context ctx = new InitialContext();
              if(ctx == null )
    throw new Exception("Boom - No Context");
              DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/imageDB");
         conn = ds.getConnection();
         stmt = conn.createStatement();      
              rs = stmt.executeQuery("Select "+imageNumber+" from images");
              rs.next();
              Blob blobImage = rs.getBlob(1);               
              getImage(blobImage,"thumb",res);
              if(rs != null) { rs.close(); }
              rs = null;
         if(stmt != null) { stmt.close(); }
         stmt = null;
         if(pstmt != null) { pstmt.close(); }
         pstmt = null;
         conn.close();
         conn = null;          
              }//try
         catch (Exception e) { }
         finally {
                   if (rs != null) {
                   try { rs.close(); } catch (SQLException e) { ; }
                   rs = null;
                   if (stmt != null) {
                   try { stmt.close(); } catch (SQLException e) { ; }
                   stmt = null;
                   if (pstmt != null) {
                   try { pstmt.close(); } catch (SQLException e) { ; }
                   pstmt = null;
                   if (conn != null) {
                   try { conn.close(); } catch (SQLException e) { ; }
                   conn = null;
              }//finally
         }//post          
              public void getImage(Blob blobImage, String imageType, HttpServletResponse res) {
                   try {                                              
                        //imageType will = Super = 600
                        // = Large = 300
                        //               = Thumb = 150
                        res.reset();
                        res.setContentType("image/jpeg");
                        BufferedInputStream bis = new BufferedInputStream(blobImage.getBinaryStream());                    
                        BufferedOutputStream bos = new BufferedOutputStream(res.getOutputStream());                                                            
                        if(imageType.equals("super")) {
                        byte[] imageBytes = new byte[(int)blobImage.length()]; //picture size           
         int length;
         while((length = bis.read(imageBytes)) > 0) {
    bos.write(imageBytes, 0, length);
         bos.flush();     
                   res.flushBuffer();
                        } else
                        if(imageType.equals("large")) {
                             resize(bis,bos,maxSizeImageWidth);
                             bos.flush();
                             res.flushBuffer();
                        } else
                        if(imageType.equals("thumb")) {
                             resize(bis,bos,maxSizeThumbWidth);
                             bos.flush();
                             res.flushBuffer();                         
                        }//if
                        //close streams
                        bis.close();
                        bos.close();
                   }//try
                   catch(Exception e) {}
              }//end          
         public void resize(BufferedInputStream bis, BufferedOutputStream bos, int maxImageWidth) {
              try {                            
              BufferedImage bufimg = ImageIO.read(bis);                                         
              //size of image
              int img_width = bufimg.getWidth();
              int img_height = bufimg.getHeight();               
              double scale = (double)maxImageWidth/(double)img_width;                    
              Image sized = getScaledInstanceAWT(bufimg, scale, Image.SCALE_SMOOTH);
              //convert image to BufferedImage
              BufferedImage resized = toBufferedImage(sized, BufferedImage.TYPE_INT_RGB);                                                                                
                        ImageIO.write(resized,"jpeg",bos);                                                                           
         }//try
         catch(Exception e){}
    }//end
    Edited by: webnotick on Apr 13, 2010 12:24 PM
    --added a method to the code snippet --                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Managing blob images using ADF and JSF or struts

    Hello everyone. I am an ADF newbe and I am developing a web app. that has to manage (display, insert,update and delete) blob images from/to an oracle DB. I've seen the "howto" on image managing using intermedia and struts, but, for this new app I wanted to use JSF (something that is not mandatory) and, what is important is that the DB has already stored the images in blob format.
    Can anybody point me in the right direction please??? Is there any howtos on this subject???
    Thanks in advance.

    jfin wrote:
    but so far I have to say that I like the fact that I'll have to do very little
    System.out.println(<..../>....<>....</>).Assuming that you rather mean out.println() where out is the ServletOutputStream reference returned by HttpServletResponse#getOutputStream(), I can only agree with you. That's certainly not the way how JSP/Servlet code is to be written. The maintainability, extendability, reusability and testability would be far below the freezing point then. You need to write presentation logic in JSP files, not in Servlets and absolutely not in scriptlets inside a JSP.
    When you need to write presentation logic which may change per request, use JSTL and EL for that. Again, not scriptlets. For business and controlling logic, use Servlets. For transfer of data, use javabeans (DTO's, VO's). For data access logic, use DAO classes which are to be interacted by servlets.
    JSF removes the need for creating Servlets and using JSTL/EL in JSP files. You just have JSP pages with JSF tags for presentation and javabeans for the request values and backing beans for business logic.
    When would one use JSF over the other two? When Struts2? When Shale?And you ask that in a JSF forum? At least my opinion is predictable :)

  • 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

  • Retrieve 2nd image if 1st image fails

    hi all GURUs,
    i have this jsp.code:
    ===============
    <%@ page contentType="text/html"%>
    <%@ page import="oracle.jdbc.driver.OracleConnection,java.sql.DriverManager, java.sql.SQLException, java.sql.*, javax.sql.*,java.io.*, java.text.*, java.util.*, javax.naming.*;"%>
    <html>
    <head>
    <title>iMAGE bLOB</title>
    </head>
    <body>
    <%
    response.setContentType("image/jpeg");
    char c;
    byte [] b;
    int i=0;
    String rs_stafinfo__MMColParam = "1";
    if (request.getParameter("stafid")!=null) {rs_stafinfo__MMColParam = (String)request.getParameter("stafid");}
    try
         Context initContext = new InitialContext();
         DataSource ds = (DataSource)initContext.lookup("java:/comp/env/jdbc/smkview");
         Connection con = ds.getConnection();
         Statement stmt=con.createStatement();
         ResultSet rs=stmt.executeQuery("select KK90PSTAFF from SMK.KK90FPSTAFF where SUBSTR(KK90UKMPER,3, 8)='"+rs_stafinfo__MMColParam+"'");
         if (rs.next())
              ServletOutputStream sout = response.getOutputStream();
              InputStream in = rs.getBinaryStream("KK90PSTAFF");
              int avlBytes = in.available();
              b = new byte[avlBytes];     /*[0x7a120]; */
              for(i = in.read(b); i >= 0;)
                   sout.write(b);
                   i = in.read(b);
              in.close();
              sout.flush();
              sout.close();
         stmt.close();
         rs.close();
         con.close();
    catch (SQLException e)
         System.err.println (e) ;
    %>
    <%=e%>
    <%
    %>
    </body>
    </html>
    ===============
    What i would like to do is if my retrieve is fail due to null column, i want to retrieve another image which is in the same table as a replacement. I've tried to put it in the else part but fail. Any clue ?
    Thanx in advance.

    I tried your solution but gives me this error...
    =====
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Exhausted Resultset
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.miseona.smson.TESTstafinfo_jsp._jspService(TESTstafinfo_jsp.java:430)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.sql.SQLException: Exhausted Resultset
         oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
         oracle.jdbc.driver.OracleStatement.prepare_for_new_get(OracleStatement.java:3378)
         oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:5854)
         oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:5833)
         oracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java:765)
         oracle.jdbc.driver.OracleResultSet.getObject(OracleResultSet.java:1470)
         org.apache.commons.dbcp.DelegatingResultSet.getObject(DelegatingResultSet.java:289)
         org.apache.jsp.miseona.smson.TESTstafinfo_jsp._jspService(TESTstafinfo_jsp.java:200)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.0.27 logs
    ====

  • Displaying BLOB image by using ADF Faces

    Hi all,
    I digged the forum but couldn't find any satisfied answer about displaying BLOB images by using ADF Faces.
    I have insterted POJO object to Oracle database but couldn't find any way to display blob (in java byte [] ) data in POJO.
    I have read the POJO object from database which contains two field; one of them is id field and other is BLOB data which holds GIF or JPG image and I want to display this image another page which contains also other fields / records ...
    thanks for your answers
    regards...
    --baris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    This thread at Sun : http://forum.java.sun.com/thread.jspa?threadID=513804&messageID=2445090
    talks about two options for creating a graphicImage jsf tag. (img tag)
    1. Make the img tag url refer to a servlet (instead of a static image file)
    2. Embed the image into the tag as inline base64 encoded data.
    2a. Use an <Object> tag with inline data.
    1. Looks a bit complex for a simple problem.
    2 and 2a don't work with some browsers.
    - And I've not yet figured out how to hook into the ADF Faces table-rendering logic to get it to add my image column. My table binds to a collection DataControl, [which in turn retrieves from a findAllItems call on a session facade, which uses my domain model, and wraps up access to a TopLink pesistence layer]. The framework just ignores my byte[] attribute when creating the jsf table from the DataControl. All string, int etc. attributes get represented correctly in the jsf table output.

  • How to store and retrieve blob data type in/from oracle database using JSP

    how to store and retrieve blob data type in/from oracle database using JSP and not using servlet
    thanks

    JSP? Why?
    start here: [http://java.sun.com/developer/onlineTraining/JSPIntro/contents.html]

  • Sending and retrieving blob data using JSP

    I need to upload images to a database through a web page (jsp)
    and then display them.
    Environment is tomcat + mysql.
    Anyone know a good site that explains
    how to work with blobs through JSP?
    thanks for any help!

    hello Sir,
    I have to make a Image Library.
    What I have done is I am just stroing the Image Path into the path
    and retrieving the path from the database.
    But now I am asked to Store the Image in the Database..
    Could U Please tell me at the time of retrieving the Image
    what exactly I have to do..
    I am just 1 month new to JSP...(Practically)
    Could U please write me the Code for Converting the BINARY Data into
    InputStream ...
    or what exactlt I have to do..
    Please Guide me man..
    Thanks In Advance...
    With Regards
    Eklavya

  • Where to find the blob viewer in sql developer

    Hi,
    i tried to find the blob viewer in sql developer to see blob column data , but failed. The manual introduce blob vievers but not mention where it is in sql developer
    can any gurus guide me to find blob viewers
    Thanks

    user10833860 wrote:
    double click the result cell of blob. the blob viewer will pop up
    This quote is from the 2nd link
    http://sqldeveloper.solyp.com/download/SQLDeveloperUserManual_en.pdfThis is not the same SQL Developer as the Oracle supplied SQL Developer.
    It shows the raw binary data unless it is a JPEG, GIF or PNG where you can see a picture.
    >
    http://download.oracle.com/docs/cd/E18464_01/doc.30/e17472/dialogs.htm
    This is better, this is the documentation for Oracle SQL Developer
    >
    Use the external editor associated with the MIME type and file extension (see the preferences for External Editor)
    >
    http://download.oracle.com/docs/cd/E18464_01/doc.30/e17472/intro.htm#CHDDJFGE
    >
    The External Editor pane determines which external editor is called by SQL Developer when you try to edit binary large object (BLOB) data, such as image files, video files, and other files created by certain applications. For each combination of MIME type and file extension, you can specify the executable application to be used to open and edit associated files.
    >
    Did you set up an application that can open the binary files of the type you want to view?

  • Problem with displaying BLOB images on JSP page using a servlet

    hi. I have a big problem with displaying BLOB images using JSP. I have a servlet that connects to the oracle database, gets a BLOB image , reads it, and then displays it using a BinaryStream. The problem is , this works only when i directly call that servlet, that is http://localhost:8080/ImageServlet. It doesn't work when i try to use that servlet to display my image on my JSP page (my JSP page displays only a broken-image icon ) I tried several coding approaches with my servlet (used both Blob and BLOB objects), and they work just fine as long as i display images explicitly using only the servlet.
    Here's what i use : ORACLE 10g XE , Eclipse 3.1.2, Tomcat 5.5.16 , JDK 1.5
    here is one of my image servlet's working versions (the essential part of it) :
                   BLOB blob=null;
              rset=st.executeQuery("SELECT * FROM IMAGES WHERE ID=1");
              while (rset.next())
                   blob=((OracleResultSet)rset).getBLOB(2);
              response.reset();
              response.setContentType("image/jpeg");
              response.addHeader("Content-Disposition","filename=42.jpeg");
                    ServletOutputStream ostr=response.getOutputStream();
                   InputStream istr=blob.getBinaryStream(1L);
                    int size=blob.getBufferSize();
              int len=-1;
                    byte[] buff = new byte[size];
                         while ((len=istr.read( buff ))!=-1 ) {
                   ostr.write(buff,0,len);
             response.flushBuffer();
             ostr.close(); and my JSP page code :
    <img src="/ImageServlet" border="0"  > If you could just tell me what i'm doing wrong here , or if you could show me your own solutions to that problem , i would be very greatful ,cos i'm realy stuck here , and i'm rather pressed for time too. Hope someone can help.

    I turns out that it wasn't that big of a problem after all. All i had to do was to take the above code and place it into another JSP page instead of into a servlet like i did before. Then i just used that page as a source for my IMG tag in my first JSP. It works perfectly well. Why this doesn't work for servlets i still don't know, but it's not a problem form me anymore . Ofcourse if someone knows the answer , go ahead and write. I would still appriceatte it.
    here's the magic tag : <img src="ImageJSP.jsp" border="0"  > enjoy : )

  • Any way to retrieve this image from my cache? When saved it only saves as a 1.7KB blank file.

    I'm trying to retrieve an image from Firefox's cache but so far have had no luck in doing so. The picture was hosted on imageshack and I had it open in a window but when I refreshed the page several hours later it was gone. I refreshed the page several more times, tried messing with the url to see if that did anything, but no luck. I haven't cleared anything on Firefox so I'm hoping there's some way I can recover it from the cache.
    I followed the instructions on this page: http://groups.google.com/group/mozilla.support.firefox/msg/73bab3fb55ac5b42
    However, when I right clicked the URL and chose "Save Link As..." it only saved a 1.7KB file that none of my photo editing programs can recognize or open. I've tried going to cache entries for other image links and saving them and when I choose Save Link As for those they save just fine, and in full size, so I'm not sure why this one won't work...I'm using Offline Mode so I'm not sure why the picture no longer being hosted online should make a difference one way or the other. I'm just hoping that my act of refreshing the page and nothing being there didn't overwrite the cache file and thus erase the cache'd image.
    So is there any hope of retrieving this picture or is it gone for good?

    Hi.
    Once the image in question is replace with another one, the old one is erased. That is to say, if you open an image, say www.domain.com/image.png, and it's a 200x200 image, then you close it, it's still on cache, and you can access it through the cache. But if the image is changed in the server, that same exact url, and you access it again, at you see a 250x200 image (just an example), then the 200x200 is gone forever.
    Your hope is that you never accessed the same URL again, so the old cache wasn't erased. If you know the url of the image, simply select offline mode (File > Work Offline, I think) and access its url. It will load the cached version and not check for the online one. Only if there is a cached version, of course.
    I hope this helps.

  • Display BLOB (image) column in (interactive) report

    Hi,
    I have a field called "picture" in my table "details" which is of type BLOB. i also have a field for "MIMETYPE" and "filename"
    i additionally have a "name" and "description" columns which i need to display along with the picture as columns in a report (preferably interactive).
    i have also modified the BLOB display format as per
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r31/apex31nf/apex31blob.htm
    what i am missing is the correct query. if possible, i would like to control the size of the picture rendered within the report like say 40*50.
    I have also referred to the thread
    APEX 3.1 Display BLOB Image
    But i don't know how to place the
    dbms_lob.getlength("BLOB_CONTENT") as "BLOB_CONTENT"
    in my query.
    The above also makes the report column as of type "number". is this expected?
    Any help would be much appreciated.
    Regards,
    Ramakrishnan

    You haven't actually said what the problem is?
    >
    I have a field called "picture" in my table "details" which is of type BLOB. i also have a field for "MIMETYPE" and "filename"
    i additionally have a "name" and "description" columns which i need to display along with the picture as columns in a report (preferably interactive).
    i have also modified the BLOB display format as per
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r31/apex31nf/apex31blob.htm
    what i am missing is the correct query.
    I have also referred to the thread
    APEX 3.1 Display BLOB Image
    But i don't know how to place the
    dbms_lob.getlength("BLOB_CONTENT") as "BLOB_CONTENT"
    >
    Something like:
    select
              name
            , description
            , dbms_lob.getlength(picture) picture
    from
              details
    if possible, i would like to control the size of the picture rendered within the report like say 40*50.For images close to this size it's easy to do this for declarative BLOB images in interactive reports using CSS. Add a style sheet with:
    .apexir_WORKSHEET_DATA td[headers="PICTURE"] img {
      display: block;
      width: 40px;
      border: 1px solid #999;
      padding: 4px;
      background: #f6f6f6;
    }where the <tt>PICTURE</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, scaling large images 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. For improved performance and image quality, and where you require image-specific scaling you can use the database ORDImage object to produce thumbnail and preview versions automatically, as described in this blog post.

  • Inserting blob images in a database

    Hi there can anyone tell me how to insert a blob image into a table; can you actually give me an example
    thanks

    use DBMS_LOB.LOADFROMFILE.
    PROCEDURE LOADFROMFILE
    Argument Name                  Type                    In/Out Default?
    DEST_LOB                       BLOB                    IN/OUT
    SRC_LOB                        BINARY FILE LOB         IN
    AMOUNT                         NUMBER(38)              IN
    DEST_OFFSET                    NUMBER(38)              IN     DEFAULT
    SRC_OFFSET                     NUMBER(38)              IN     DEFAULT

  • How to display a blob image in RTF template's Header.

    Hi,
    I want to display a blob image (logo company) in my RTF template,
    my problem is how i can display this image in the template's Header.
    I tried this
    <?
    <fo:instream-foreign-object content-type="image/jpeg" >
    <xsl:value-of select=".//LOGO"/>
    </fo:instream-foreign-object>
    ?>
    but was unsuccessful
    Thanks in advance.

    I tried this
    <?
    <fo:instream-foreign-object content-type="image/jpeg" >
    <xsl:value-of select=".//LOGO"/>
    </fo:instream-foreign-object>
    ?>
    but was unsuccessful
    sure
    what is red elements ?
    you template can be looks like
    ..... some data .....
    ( after  all data )
    <?template:footer_logo?>
    <fo:instream-foreign-object content-type="image/jpeg" ><xsl:value-of select=".//LOGO"/></fo:instream-foreign-object> (as field )
    <?end template?>
    <?call-template:footer_logo?> ( in header/footer )
    some remarks https://oralublog.wordpress.com/2014/10/04/bi-publisher-11g-footers-and-headers-in-rtf-template/

Maybe you are looking for

  • How to read the hierarchy data from the same table using loop in AMDP method

    Hi All, We have a requirement to get the top partner from BUT050 table. Here the Top parent is nothing but the top most in the hierarchy of the partners from BUT050. Example: For partner 1234 (BUT050-PARTNER1) there is partner 3523(BUT050-PARTNER2) o

  • Problem with Remote Desktop on iPad 2 and windows 8.1 pro

    I downloaded the Microsoft Remote Desktop app from the App Store on my iPad 2. I typed in the IP address for my windows 8.1 pro computer on my iPad 2 in school to try connecting to my windows 8.1 pro computer at home. I'm having a hard time doing it.

  • Insert vendor email into master data

    Hello all, I would like to insert e-mail data into FK02 by using LSMW (recording) to the field SMTP_ADDR. the sys insert it to a non comfortable place ("other communication") any suggest ? thanks in advance, Ronen

  • FM to create Position and Org  unit

    Hi  Friends- What are the Function Module to create  Position and Org unit in  HR ?   Regards Meeta

  • Hp Simple Pass stopped working Pavilion dv7 4183cl

    the HP SimplePass on our Pavilion dv7 laptop has stopped working properly - when I scan my fingerprint it takes me to Google.com for every location I have set up instead of going to the correct location - this just started a few days ago.  When I che