How to show long raw picture  in adf jsp

Pictures are stored in long raw column in oracle database. I have followed to show picture based on servlet to retrieve image from blob column but to no success. Kindly help.

Thanks for helping.
I have  already used following servlet but no picture. I think problem is in specific line because image is in Long Raw instead of Blob..
Blob blob = rs.getBlob("PLAN_PIC");
Image Servlet
public class imageservlet extends HttpServlet {
    private static final String CONTENT_TYPE = "text/html; charset=UTF-8";
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
    public void doGet(HttpServletRequest request,
                      HttpServletResponse response) throws ServletException,
                                                           IOException {
        response.setContentType(CONTENT_TYPE);
        String imageId = request.getParameter("id");
       // String imageId="4000";
        OutputStream os = response.getOutputStream();
        Connection conn = null;
        try {
            Context ctx = new InitialContext();
            //Datasource as defined in <res-ref-name> element of weblogic.xml
            DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/DYEDS");
            conn = ds.getConnection();
            PreparedStatement statement =
                conn.prepareStatement("SELECT plan_no, plan_pic " +
                                      "FROM tblplanpics " +
                                      "WHERE plan_no = ?");
           // statement.setInt(1, new Integer(imageId));
            statement.setString(1,imageId);
            ResultSet rs = statement.executeQuery();
            if (rs.next()) {
         //       Blob blob = rs.getBlob("PLAN_PIC");
              Blob blob = rs.getBlob("PLAN_PIC");
                BufferedInputStream in =
                    new BufferedInputStream(blob.getBinaryStream());
                int b;
                byte[] buffer = new byte[10240];
                while ((b = in.read(buffer, 0, 10240)) != -1) {
                    os.write(buffer, 0, b);
                os.close();
        } catch (Exception e) {
            System.out.println(e);
        } finally {
            try {
                if (conn != null) {
                    conn.close();
            } catch (SQLException sqle) {
                System.out.println("SQLException error");

Similar Messages

  • Long Raw Picture not showing in adf

    I have used following servlet to show long raw picture. the problem is in line
    Blob blob = rs.getBlob("PLAN_PIC"); 
    The oracle column is Long Raw  and in ADF table this column shows as Raw. I have tried to use Raw class but could not identify proper functions. For example I used      Long blob=rs.getLong("PLAN_PIC"); it is ok but then how to get its buffered binary stream because getBinaryStream() does not work for long. I also tried to use to_blob function to convert long raw column to blob but it also gives ora-0932 error. The same table shows picture in oracle form and also Dot Net developer showed the same picture. Kindly help.
    //servlet code is
    public class imageservlet extends HttpServlet {
       // private static final String CONTENT_TYPE = "text/html; charset=UTF-8";   ( I checked both content types but nothing)
          private static final String CONTENT_TYPE =   "image/jpg; charset=utf-8";
        public void init(ServletConfig config) throws ServletException {
            super.init(config);
        public void doGet(HttpServletRequest request,
                          HttpServletResponse response) throws ServletException,
                                                               IOException {
            response.setContentType(CONTENT_TYPE);
            String imageId = request.getParameter("id");
           // String imageId="4000";
            OutputStream os = response.getOutputStream();
            Connection conn = null;
            try {
                Context ctx = new InitialContext();
                //Datasource as defined in <res-ref-name> element of weblogic.xml
                DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/DYEDS");
                conn = ds.getConnection();
                PreparedStatement statement =
                    conn.prepareStatement("SELECT plan_no, plan_pic " +
                                          "FROM tblplanpics " +
                                          "WHERE plan_no = ?");
               // statement.setInt(1, new Integer(imageId));
                statement.setString(1,imageId);
                ResultSet rs = statement.executeQuery();
                if (rs.next()) {
                   Blob blob = rs.getBlob("PLAN_PIC");     
                    BufferedInputStream in =
                        new BufferedInputStream(blob.getBinaryStream());
                    int b;
                    byte[] buffer = new byte[10240];
                    while ((b = in.read(buffer, 0, 10240)) != -1) {
                        os.write(buffer, 0, b);
                    os.close();
            } catch (Exception e) {
                System.out.println(e);
            } finally {
                try {
                    if (conn != null) {
                        conn.close();
                } catch (SQLException sqle) {
                    System.out.println("SQLException error");

    The answers are the same as in your other thread https://forums.oracle.com/thread/2591893 about this issue.
    Timo

  • How can I get RAW pictures to open in PSE 12 and PSE 13?  I have installed the plugin 8.7.1 but it wont work with either.

    What can I do when I have downloaded RAW plugin 8.7.1 and it wont work on either PSE 12 or PSE 13????

    Hi I asked a computer engineer to install RAW plug in 8.7.1. on PSE 12 for me, and he couldnt do it either.   I have bought PSE 13 and followed the advise I was given - go to Edit - expert - Help - plugins - RAW - update- and IT WORKS !!!    DW
    Original message----
    From : [email protected]
    Date : 25/01/2015 - 11:53 (GMTST)
    To : [email protected]
    Subject :  How can I get RAW pictures to open in PSE 12 and PSE 13?  I have installed the plugin 8.7.1 but it wont work with either.
        How can I get RAW pictures to open in PSE 12 and PSE 13?  I have installed the plugin 8.7.1 but it wont work with either.
        created by susanl96972449 in Photoshop Elements - View the full discussion
    Hello, I have been experiencing similar problems and followed the suggestion and yes, the raw icon comes up as illustrated but there is nothing there to indicate any further action can be taken.  So I am presuming that means it is installed and no further action required?
    Here's my problem:  I have had no problems  getting my pics into my organiser in Elements 12 from either my Nikon D7100 or my Fujifilm X100S - until last week.  Suddenly when they are imported all I see is the timer icons but they don't open to let me view them.  If I click on one it will open and I can then edit it but it will not save an image onto the grid for me to view so it's really frustrating not being able to view all my photos in order to decide what to edit and compare them.
    Here's what action I've taken so far - restarted the computer (endlessly), checked the updates and installed them, checked I have the latest raw plug in (I do) and gone into edit/update thumbnail (doesn't do a thing) - and torn out a fair amount of my hair.  So anyone out there experienced this and can give me some advice? Please?
    If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7129439#7129439 and clicking ‘Correct’ below the answer
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7129439#7129439
    To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"
    Start a new discussion in Photoshop Elements by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • Long Raw column in ADF Form

    Hi!
    I have a long raw column and I would like show it in a ADF Form. The column content is an image.
    Thanks

    Hi,
    you will have to stream the image using a servlet that you reference from an image object. If you Google for this then you find recent blog posts and forum entries about this
    Frank

  • How to show long text in TextView control in formatted form?

    Hi,
    I have requirement to show long text from backend text edit control to WD application. I am using READ_TEXT Fm to read the long text and passing it to text view UI element.
    The text is shown in simply one long line but I want it to show in the same format as stored in backend textedit control.
    If I take textedit UI control then it shows the text in formatted form.
    Could you please let me know how to achieve these for TextView control? My requirement is that I have to use only TextView control.
    Thanks,
    Chandra

    Hi,
    The Problem solved to some extend but still the exact formatting is not happening though i am using cl_abap_char_utilities=>newline.
    for eg. if the long text is as below.
    "To display the external component, you can now embed an interface view of any window of this component in a window of your current embedding a view of oneu2019s own component. By setting up navigation from one outbound plug of a view of your inbound plug of the inter external component, you enable the external component to be displayed. New line ."
    and if in backend the Last line " New line ." is on next line, on WD it is not displayed on next line.
    Thanks,
    Chandra

  • How to read LONG RAW data from one  table and insert into another table

    Hello EVERYBODY
    I have a table called sound with the following attributes. in the music attribute i have stored some messages in the different language like hindi, english etc. i want to concatinate all hindi messages and store in the another table with only one attribute of type LONG RAW.and this attribute is attached with the sound item.
    when i click the play button of sound item the all the messages recorded in hindi will play one by one automatically. for that i'm doing the following.
    i have written the following when button pressed trigger which will concatinate all the messages of any selected language from the sound table, and store in another table called temp.
    and then sound will be played from the temp table.
    declare
         tmp sound.music%type;
         temp1 sound.music%type;
         item_id ITEM;
    cursor c1
    is select music
    from sound
    where lang=:LIST10;
    begin
         open c1;
         loop
              fetch c1 into tmp; //THIS LINE GENERATES THE ERROR
              temp1:=temp1||tmp;
              exit when c1%notfound;
         end loop;
    CLOSE C1;
    insert into temp values(temp1);
    item_id:=Find_Item('Music');
    go_item('music');
    play_sound(item_id);
    end;
    but when i'm clicking the button it generates the following error.
    WHEN-BUTTON-PRESSED TRIGGER RAISED UNHANDLED EXCEPTION ORA-06502.
    ORA-06502: PL/SQL: numeric or value error
    SQL> desc sound;
    Name Null? Type
    SL_NO NUMBER(2)
    MUSIC LONG RAW
    LANG CHAR(10)
    IF MY PROCESS TO SOLVE THE ABOVE PROBLEM IS OK THEN PLESE TELL ME THE SOLUTION FOR THE ERROR. OTHER WISE PLEASE SUGGEST ME,IF ANY OTHER WAY IS THERE TO SOLVE THE ABOVE PROBLEM.
    THANKS IN ADVANCE.
    D. Prasad

    You can achieve this in many different ways, one is
    1. Create another VO based on the EO which is based on the dest table.
    2. At save, copy the contents of the source VO into the dest VO (see copy routine in dev guide).
    3. commiting the transaction will push the data into the dest table on which the dest VO is based.
    I understand that if we attach VO object instance to region/page, we only can pull and put data in to only one table.
    if by table you mean a DB table, then no, you can have a VO based on multiple EOs which will do DMLs accordingly.Thanks
    Tapash

  • How to Show Inline Message in Oracle ADF 11g Release 1.

    Can you please tell me how to show inline error Message on particular field.

    If I understand your requirement correctly you need to show a particular error message showing a red mark around the field like in required case right ?
    You would need to do it programmatically by using the following code -
                    FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR,"Error on this field", null);
                    facesContext.addMessage(uiComponent.getClientId(facesContext), msg);//where uiComponent is the binding of the component in the bean ,on which the error needs to be shown.

  • How to transfer long raw between servers

    There is a view in remote server that has included long raw field in which images are stored in tiff format.
    I want to transfer them to a local server. When I searched I found out that one way to do such transfer is copy command in sqlplus.
    When I used this command to transmit the data, long raw field has failed. Given that I can not give a dump, what way I can choose to transfer long raw data.

    Difficult to say if you keep information about your Oracle version secret.

  • HOW to USE 'LONG RAW' in Bulk Insertion using OCI

    Hi,
    I need to do bulk insertion of LONG RAW data into a table using the OCI.
    To the OCIBindByPos API what should I specify in the field size(value_sz). As different records can have different lenght for this LONG RAW data what value should I provide.
    Thanks,
    Tuhin
    sword OCIBindByPos ( OCIStmt *stmtp,
    OCIBind **bindpp,
    OCIError *errhp,
    ub4 position,
    dvoid *valuep,
    sb4 value_sz,
    ub2 dty,
    dvoid *indp,
    ub2 *alenp,
    ub2 *rcodep,
    ub4 maxarr_len,
    ub4 *curelep,
    ub4 mode );

    ORA-00997: illegal use of LONG datatype
    Cause: A value of datatype LONG was used in a function or in a DISTINCT, WHERE, CONNECT BY, GROUP BY, or ORDER BY clause. A LONG value can only be used in a SELECT clause.
    Action: Remove the LONG value from the function or clause
    Are you using the column anywhere else but in the SELECT?

  • How do I download RAW pictures from a Panasonic TZ60 into Elements, keeps telling me file damaged or in format not recognised.

    I have just purchased a Panasonic TZ60 which is producing some good quality pictures. The camera can be set to save picture in jpeg, RAW and jpeg and RAW but I have been unable to download any RAW pictures into either iPhoto or Elements. Both programmes see the file but won't download and comes up with message saying file damaged or not recognised.
    I have tried just transferring RAW picture file to my desktop and then into Elements, still no joy.

    Thanks John
    Missed updating so went in search and found update path and that has resolved and can now pull in RAW, just need to crack iPhoto now and will be happy again.
    Thanks for help
    Garry

  • How to show a PDF with a JSF jsp.

    Hello,
    I want to show a PDF in a JSF jsp.
    I'm a newbie with this, and don't know where to look for information about that.
    Any example on the web ?
    Thanks in advance

    I think you will need to eventually get it to the HTML <object> tag anyway.
    <OBJECT data="yourPDFhere.pdf" type="????""/>
    and to get the byte[] to the client you may need to make a Servlet to respond to *.pdf requests and feed the correct session 'in memory' pdf out the stream.
    Here is an example from some svg 'in memory' per session I was testing:
    * SessionServlet.java
    * Created on June 3, 2004, 12:09 AM
    package com.hypernex.xml.svg;
    import java.io.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * @author  Roger I Martin, PhD
    * @version
    public class SessionServlet extends HttpServlet
        /** Initializes the servlet.
        public void init(ServletConfig config) throws ServletException
            super.init(config);
        /** Destroys the servlet.
        public void destroy()
        /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
            ServletContext context=getServletContext();
            java.util.Enumeration e=context.getServlets();
            while(e.hasMoreElements())
                System.out.println("servlets \t"+e.nextElement());
            /*e=context.getAttributeNames();
            while(e.hasMoreElements())
                System.out.println("AttributeNames \t"+e.nextElement());
            e=request.getParameterNames();
            while(e.hasMoreElements())
                System.out.println("ParameterNames \t"+e.nextElement());
            System.out.println("getContextPath "+request.getContextPath());
            System.out.println("getRequestURI"+request.getRequestURI());
            response.setContentType("text/xml+svg");
            PrintWriter out = response.getWriter();
            HttpSession httpSession=request.getSession();
            System.out.println("getQueryString"+httpSession);
            if(httpSession!=null && request.getRequestURI().endsWith("wafermap.svg"))
                /*e=httpSession.getAttributeNames();
                while(e.hasMoreElements())
                    System.out.println("httpSession AttributeNames \t"+e.nextElement());
                SVGProducer svgProducer=(SVGProducer)httpSession.getAttribute("waferMap");
                out.print(svgProducer.getSVGView());
            else if(httpSession!=null && request.getRequestURI().endsWith("hardware.svg"))
                SVGProducer svgProducer=(SVGProducer)httpSession.getAttribute("hardwareBean");
                out.print(svgProducer.getSVGView());
            else if(httpSession!=null && request.getRequestURI().endsWith("geometry.svg"))
                SVGProducer svgProducer=(SVGProducer)httpSession.getAttribute("geometryBean");
                out.print(svgProducer.getSVGView());
            else
                try
                    java.io.BufferedReader br=new java.io.BufferedReader(new java.io.FileReader("./webapps"+request.getRequestURI()));
                    String line=null;
                    while((line=br.readLine())!=null)
                        out.println(line);
                    br.close();
                catch(java.io.IOException ioe)
                    System.out.println("ioe:"+ioe.getMessage());
            out.close();
        /** Handles the HTTP <code>GET</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
            processRequest(request, response);
        /** Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
            processRequest(request, response);
        /** Returns a short description of the servlet.
        public String getServletInfo()
            return "SVG graphics handler";
    }

  • How to run long background jobs in ADF applications

    Hi,
    I'm looking for some guidance on how to run an asynchronous job within an ADF application with proper progress notification in the current page.
    Let's assume we have some long running task (e.g. generating notification emails from a bunch of rows in my view object and send them) with the corresponding classes implemented in the DataModel as part of the business logic (e.g. a class that sends a mail to a given recipient).
    Let's assume all the relevant methods can be exposed in the appmodule's client interface so they can be invoked from the ViewController if needed.
    In my jspx page I have implemented the standard af:poll+af:progressIndicator mechanism to give feedback about the running task, backed by a custom BoundedRangeModel
    with methods getValue() and getMaximum(). This works.
    However, all the examples I've found on the net are very very simplistic and only deal with simple counters or countdowns.
    But how to actually implement the whole mechanism in a real life scenario? How do I run the job itself and make it give feedback to my BoundedRangeModel class
    (which in turn is used by the progressIndicator on the page)?
    Is there a recommended way to do this within ADF apps? I've tried to search something about asynchronous method execution in ADF but there seems to be nothing out there.
    Do I need to use standard Java techniques such as a separate Thread running a Runnable worker? Should I use an observer/observable pattern to notify BoundedRangeModel
    and update its internal variables (current value and maximum)? Would this work across a Datacontrol interface?
    Is anything of this allowed within the ADF framework or I'm just gonna break the whole framework model because do-it-yourself concurrent programming isn't allowed in a multithreaded pooled environment?
    Some explanation about the current recommended best practices and/or some practical examples or articles about that would be great.
    (BTW: I'm using version 11.1.1.2.0 and yes, I've checked the contextual events thing too, but that's just an inter-page communication mechanism so it has has nothing to do with what I need to do.)

    Hi
    I have implement a "Runner" class to generate a pdf to every customer of a mailmerge file, which was uploaded. Its simply easy to do something like this. Just add a button, bound the button with a methode out of you applicationModule and start your implementing Thread in this methode.
    public class Runner implements Runnable {
        private String docFileName;
        private String csvFileName;
        private byte[] csvData;
        private byte[] docData;
        private FtpClient client;
        private String category;
        public Runner(String category, String docFileName, byte[] docData,
                      String csvFileName, byte[] csvData, FtpClient client) {
            this.category = category;
            this.docFileName = docFileName;
            this.docData = docData;
            this.csvFileName = csvFileName;
            this.csvData = csvData;
            this.client = client;
        public void run() {
    }In your applicationModule, you can start your Runner like this:
            Runner runner =
                new Runner(category, docFileName, docData, csvFileName, csvData, client);
            new Thread(runner).start();And to the problem with your progressBar. I would create a managedBean with a HashMap<String, HashMap<String, String>>. Every thread you start, add a HashMap<String, String> to this hashmap with the id of the username/session/whatever (must be bound to the user, which starts the thread). This added HashMap<String, String> should be used by your thread to put some status-information into. Now you can try to bind this info to your progressBar.
    I dont know if this will work, it is just an idea ;-)
    Regards
    Majo

  • How to print long raw text data in report output in single line?

    Hi All,
    I have a requirement where I need to print raw comma separated text data in the report output which end user will open in excel and can sort as required. I can not directly generate excel output.
    Now there is huge set of data and each row from the report query should be get printed on single line, It should not get printed on the next line.
    I tried to extending the report with 240 characters but still there are some text data which is getting printed on the next line.
    Please share your view if someone has any solution on this issue.
    Thanks in Advance.
    Arun

    Make the report even wider. By default a report layout can be 10 pages wide. If you need more, change the "Max. Horizontal Body Pages" property, and extend your layout too.
    IMHO, I wouldn't even use Reports to create a csv file. Utl_file or an sqlplus script that spools to a file are better options I think.

  • How to show movies and pictures as moving objects over animations.

    I'm creating a wedding movie, and i want to display some pics and video as well as the typical airplane animation flying from Toronto to Mexico with the red dotted line.. Any ideas where to start?

    Studio X wrote:
    .. typical airplane animation flying from Toronto to Mexico with the red dotted line..Any ideas where to start?
    In Toronto?

  • How to show an xml content in a Jsp page?

    I use <jsp:include page=".....xml" /> tag in a jsp file to include an xml file. When this jsp page is open, only the text content in the xml file shows up with plain text. I want this xml file shows up like in IE (with xml format). Does anyone know how to do it? Thanks.
    northcloud

    Thank you, BalusC & evnafets. Someone told me to use <c:import> to load the XML file into a scoped variable, and then use <c:out> to display it. The <c:out> will automatically convert the markup to HTML entities. I tried it, it works. It shows the content in the xml file as plain text (a long string). Any one give me some suggestion to make it looking better, for example, show each element in seperated lines. Thanks.

Maybe you are looking for