Retrieve multiple images from database to servlet

Hi there,
I try to retrieve more than one images from database to Servlet/JSP . However, I get only one images in the result set. Here is my code. Please Help .
How do I display more than one images ( multiple rows ) from database to Servlet ?.
When I retrieve, I got 3 rows of binary data, but I don't know how to display it on the Servlet/JSP pages.
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import java.lang.*;
import java.sql.*;
import com.sybase.jdbcx.*;
public class RetrievePhoto extends HttpServlet {
static ResultSet rs;
static CallableStatement NGSstmt = null;
static Connection NGScon = null;
static SybDriver _driver = null;
public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException {
ServletOutputStream os = res.getOutputStream();
String driver = ""
String URL = "";
String Host = "";
String UN = ""; //assign your username here
String PW = ""; //assign your password here
try {
Class c = Class.forName( driver );
_driver = (SybDriver) c.newInstance();
DriverManager.registerDriver( (SybDriver) _driver );
NGScon = DriverManager.getConnection( URL + Host, UN, PW );
} catch ( SQLException e ) {
os.println( "Unable to load the Sybase JDBC driver. " + e.toString() );
e.printStackTrace(System.out);
} catch (java.lang.Exception ex) {
// Got some other type of exception. Dump it.
os.println("Exception - java lang " + ex.getMessage() );
String PID = req.getParameter("PID"); //passing parameters from Servlet
try {
String SQLcmd = "{call RET_PHOTO_BY_PID(?)}";
NGSstmt = NGScon.prepareCall( SQLcmd );
//execute the query
synchronized (NGSIDBstmt)
NGSstmt.setString(1, PID); //passing parameter to store procedure
rs = NGSstmt.executeQuery();
byte[] stuff = new byte[1024];
int bytesRead = 0;
res.setContentType("image/gif");
InputStream is = null;
// Get the first row
while( rs.next() ) {
is = rs.getBinaryStream("PHOTO");
res.setContentLength(is.available());
for (int i=0;; i++) {
bytesRead = is.read(stuff);
os.write(stuff);
if ( bytesRead == -1 ) break;
rs.close();
os.flush();
os.close(); //close outputstream
} catch ( SQLException sqle) {
os.println("Error in SQL2Exception" + sqle.getMessage());

When I retrieve, I got 3 rows of binary data, but I don't know how to display it on the Servlet/JSP pages.I will pick this bit of your post, because you seemed to have several partly-overlapping questions.
You are going about this wrong. You need to decide what your HTML will look like before you start writing servlet code. In this case you want to have something like a table, with an image in each row, right? Now what does the HTML for that look like? It's a <table> element, and so on, but what about the images? Well this is HTML, so it can't contain the binary images. It has to contains links to the images, and the browser will download the image from each of those links and put all of the downloads together into the page it displays.
That means you can't do it all with one servlet. You need a main servlet that generates the HTML, with the <table> element and the links to the images. Probably you need some DB calls here to find out how many images you're going to have, but you don't need to get them in this servlet. You just need to generate a link for each of them.
Then you need a second servlet that gets an image. It's going to get a single row from the DB and return the binary image you read from that row. Make sure to use "image/jpg" or whatever's appropriate instead of "text/html" in your response's content type here.
I will leave you to carry on from here. First step is to design the HTML that your main servlet will produce; remember that the links it generates need to carry enough information for the second servlet to be able to find the right image in the DB.
PC&#178;

Similar Messages

  • 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

  • Browse image from database

    hi evey body
    i wish some one help me for solve this problem .
    when i use jdeveloper 11g to browse image from database using servlet (*without using Dynamic JDBC Credentials*) i can browse the image,
    but when i use jdeveloper 11g to browse image from database using servlet with the solution by Steve Muench, Dynamic JDBC Credentials i always get this error :
    java.Null.pointerException
    Caused By: java.sql.SQLException: ORA-01005: null password given; logon denied
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:406)
    Truncated. see log file for complete stacktrace .
    my question why i get this error? is servlet open new session ??
    thanks in advance
    maher

    hi every body
    sorry for my repeated request , i wish some body help me to solve my problem or ask me some thing about my problem .
    this the last request for this question and i will not upset you again .
    thanks in advance
    maher

  • Retriving an Image From Database

    Hi friends i tried to retrieve an image from database and get some sample code from one website and try to run. But an error will be displayed please help me..... this is the code............
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    import java.io.*;
    import java.sql.*;
    class GetBlob {
    FileOutputStream image;
    Connection con = null;
    PreparedStatement pstmt = null;
    Statement stmt= null;
    ResultSet res = null;
    StringBuffer query=null;
    String driverName = "sun.jdbc.odbc.JdbcOdbcDriver";
    String url = "jdbc:odbc:image";;
    public GetBlob(){
    try{
    Class.forName(driverName);
    con = DriverManager.getConnection(url);
    stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery("SELECT * FROM save_image where id="+"1"+"");
    if (rs.next()) {
    System.out.println(rs.getString(2));
    Blob test=rs.getBlob("image");
    InputStream x=test.getBinaryStream();
    int size=x.available();
    OutputStream out=new FileOutputStream("C:\\anu.jpg");
    byte b[]= new byte[size];
    x.read(b);
    out.write(b);
    catch(Exception e){
    System.out.println("Exception :"+e);
    finally{
    try{
    stmt.close();
    con.close();
    catch(Exception e){
    System.out.println(e);
    public static void main(String args[]) throws IOException{
    GetBlob blob = new GetBlob();
    The error is
    java.lang.UnsupportedOperationException
    please help me...

    Use a real database and a real driver. MS Access and ODBC bridge aren't.

  • Retrieving image from database?

    Hi there,
    I am a newbie in java and i use MySql as my database. My problem is, how can i retrieve an image from my database and display it to a container(JLabel, JTextArea etc...)??
    If you dont mind could you please give me a "simple" sample code for this one.. Thank you and God Bless :-)

    [http://forums.sun.com/thread.jspa?threadID=5346264]
    These links were really funny............but I think s/he forgot to mark the topic as question as it was first post.....

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

  • FWD: Re: Retrieving multiple rows from a database into morethan

    There are two ways to do this that I cn think of right off the bat.
    One is to create a class of objects that can receive the entire row, and
    give it methods that will return each of the individual objects that you are
    looking for when called. If you use INTO :ARRAY, you get the advantage of
    being able to pass the array anywhere in your system for the 'split up'
    processing.
    Two is to do basically the same thing, but instead doing the 'split up'
    during a for loop. This will appear to slow down your query, however, as
    extra processing will be occuring in terms of memory allocation and copying.
    I'm sure there other approaches. This was simply what came to mind at
    midnight, after a long day :-).
    At 01:33 AM 6/4/96 +0000, you wrote:
    Does anyone know of a way to retrieve multiple rows from a single table in an
    RDB database into more than 1 object, using a single SQL call?
    I have a single table that I wish to use some fields to populate one object
    and some others to populate another.
    The FOR clause only allows one object to be specified.
    The INTO :ARRAY clause also seems to only allow one object to be specified.
    I would appreciate any help.
    Regads,
    Steve Isaac
    Hydro Electric Commission
    Hobart TAS 7001
    Australia
    [email protected]
    James Urquhart Voice: (510)869-3400
    [email protected] Fax: (612)921-8243
    Forte Consulting

    wow, that was pleasant, the usual format goes:
    Newb: I have a problem, fix it for me
    Forum: Here's a link explaning the concept you obviously don't grasp
    Newb: No, fix it FOR me
    Forum: I'll fix you!
    Newb: WAAAAH!
    Forum: BAN!

  • Display Images from Database

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

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

  • Problem in sending image from applet to servlet

    dear friends,
    i have a need to send an image from applet to servlet via HttpConnection and getting back that image from applet.
    i am struggling with this sice many hours and got tired by searching any post that would help me but haven't got yet.
    i tried using this code but it dosent make any execution sit right. i got NPE at ImageIcon.getDescription() line;
    at applet side
          jf.setContentPane(getJContentPane());
                     FileDialog fd=new FileDialog(jf,"hi");
                     fd.setMode(FileDialog.LOAD);
                     fd.setVisible(true);   
                     v=new Vector();
                     try{                                                
                               FileInputStream fis=new FileInputStream(new File(fd.getDirectory()+fd.getFile()));      
                               byte[] imgbuffer=new byte[fis.available()];
                               fis.read(imgbuffer);
                               ImageIcon imgdata=new ImageIcon(imgbuffer);
                               v.add(0,imgicon);
                                String strwp ="/UASProject/Storeimage";              
                                URL servletURL = new URL(getCodeBase(),strwp);             
                                HttpURLConnection servletCon = (HttpURLConnection)servletURL.openConnection();       
                                servletCon.setDoInput(true); 
                                servletCon.setDoOutput(true);
                                servletCon.setUseCaches(false);
                                servletCon.setDefaultUseCaches(false);   
                                servletCon.setRequestMethod("POST");     
                                servletCon.setRequestProperty("Content-Type", "application/octet-stream");   
                                servletCon.connect();            
                                ObjectOutputStream oboutStream = new ObjectOutputStream(servletCon.getOutputStream());                     
                                oboutStream.writeObject(v);
                                v.remove(0);
                                oboutStream.flush();      
                                oboutStream.close();  
                                //read back from servlet
                                ObjectInputStream inputStream = new ObjectInputStream(servletCon.getInputStream());
                                 v= (Vector)inputStream.readObject();                     
                                 imgicon=(ImageIcon)v.get(1);
                                 showimg.setIcon(imgicon);
                                 this.getContentPane().validate();
                                 this.validate();  
                                inputStream.close();                                                        
                             //  repaint();
                     }catch(Exception e){e.printStackTrace();}  and this is at servlet side
            try {       
                         Vector v=new Vector();                    
                         ObjectInputStream inputFromjsp = new ObjectInputStream(request.getInputStream());                                      
                          v = (Vector)inputFromjsp.readObject();                                                                                                          
                          imgicon=(ImageIcon)v.get(0);                     
                          inputFromjsp.close();            
                          System.out.println(imgicon.getDescription());                                      
                          v.remove(0);
                          v.add(1,imgicon);
    //sending back to applet
                           response.setContentType("application/octet-stream");
                          ObjectOutputStream oboutstream=new ObjectOutputStream(response.getOutputStream());            
                          oboutstream.writeObject(v);
                          oboutstream.flush();
                          oboutstream.close();
                   } catch (Exception e) {e.printStackTrace();}  i really need your help. please let me out of this headche
    thanks
    Edited by: san_4u on Nov 24, 2007 1:00 PM

    BalusC wrote:
    san_4u wrote:
    how can i made a HttpClient PostMethod using java applets? as i have experience making request using HttpURLConnection.POST method. ok first of all i am going make a search of this only after i will tell. please be onlineOnce again, see link [3] in my first reply of your former topic.
    yeah! i got the related topic at http://www.theserverside.com/tt/articles/article.tss?l=HttpClient_FileUpload. please look it, i am reading it right now and expecting to be reliable for me.
    well what i got, when request made by html code(stated above) then all the form fields and file data mixed as binary data and available in HttpServletRequest.getinputstream. and at servlet side we have to use a mutipart parser of DiskFileItemFactory class that automatically parse the file data and return a FileItem object cotaing the actual file data,right?.You can also setup the MultipartFilter in your environment and don't >care about it further. Uploaded files will be available as request attributes in the servlet.is the multipartfilter class file available in jar files(that u suggested to add in yours article) so that i can use it directly? one more thing the import org.apache.commons.httpclient package is not available in these jar files, so where can got it from?
    one mere question..
    i looked somewhere that when we request for a file from webserver using web browser then there is a server that process our request and after retrieving that file from database it sends back as response.
    now i confused that, wheather these webservers are like apache tomcat, IBM's webspher etc those processes these request or there is a unique server that always turned on and process all the request?
    because, suppose in an orgnisation made it's website using its own server then, in fact, all the time it will not turned on its server or yes it will? and a user can make a search for kind of information about this orgnisation at any time.
    hopes, you will have understand my quary, then please let me know the actual process
    thanks
    Edited by: san_4u on Nov 25, 2007 11:25 AM

  • Not able to download image from database

    not able to download image from database am in jdeveloper 11g release 2 am using this example
    : http://tompeez.wordpress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-2/
    hi am not able to down load my image my jsp xml is
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document title="sms4200.jspx" id="d1">
    <af:messages id="m1"/>
    <af:form id="f1" usesUpload="true">
    <af:panelStretchLayout topHeight="211px" id="psl1" inlineStyle="width:1338px; background-color:Navy;">
    <f:facet name="top">
    <af:panelHeader text="Sms Intergration Sources" id="ph1">
    <f:facet name="context"/>
    <f:facet name="menuBar"/>
    <f:facet name="toolbar"/>
    <f:facet name="legend"/>
    <f:facet name="info"/>
    <af:panelStretchLayout id="psl2" inlineStyle="height:178px; width:1018px;" topHeight="22px"
    endWidth="589px" startWidth="55px" bottomHeight="33px">
    <f:facet name="end">
    <af:panelHeader text="Office" id="ph2"
    inlineStyle="width:900px; background-color:Navy;">
    <f:facet name="context"/>
    <f:facet name="menuBar"/>
    <f:facet name="toolbar"/>
    <f:facet name="legend"/>
    <f:facet name="info"/>
    <af:panelFormLayout id="pfl3" inlineStyle="background-color:Navy;" rows="1">
    <f:facet name="footer"/>
    <af:inputText label="#{bindings.Name1.hints.label}"
    required="#{bindings.Name1.hints.mandatory}"
    columns="20"
    maximumLength="#{bindings.Name1.hints.precision}"
    shortDesc="#{bindings.Name1.hints.tooltip}" id="it2">
    <f:validator binding="#{bindings.Name1.validator}"/>
    </af:inputText>
    <af:inputText
    label="#{bindings.LocalUpDirectory1.hints.label}"
    required="#{bindings.LocalUpDirectory1.hints.mandatory}"
    columns="20"
    maximumLength="#{bindings.LocalUpDirectory1.hints.precision}"
    shortDesc="#{bindings.LocalUpDirectory1.hints.tooltip}"
    id="it3">
    <f:validator binding="#{bindings.LocalUpDirectory1.validator}"/>
    </af:inputText>
    </af:panelFormLayout>
    </af:panelHeader>
    </f:facet>
    <f:facet name="top">
    <af:inputText value="#{bindings.IntegrationTypeName1.inputValue}"
    label="#{bindings.IntegrationTypeName1.hints.label}"
    required="#{bindings.IntegrationTypeName1.hints.mandatory}"
    columns="#{bindings.IntegrationTypeName1.hints.displayWidth}"
    maximumLength="#{bindings.IntegrationTypeName1.hints.precision}"
    shortDesc="#{bindings.IntegrationTypeName1.hints.tooltip}" id="it1">
    <f:validator binding="#{bindings.IntegrationTypeName1.validator}"/>
    </af:inputText>
    </f:facet>
    </af:panelStretchLayout>
    </af:panelHeader>
    </f:facet>
    <f:facet name="center">
    <!-- id="af_one_column_header_stretched" -->
    <af:decorativeBox theme="dark" id="db1" inlineStyle="width:1050px; background-color:Navy;">
    <f:facet name="center">
    <af:panelGroupLayout layout="scroll" id="pgl3" inlineStyle="background-color:Navy;">
    <af:panelStretchLayout id="psl3" inlineStyle="width:1012px; height:502px;"
    topHeight="133px" startWidth="0px">
    <f:facet name="center">
    <af:panelStretchLayout id="psl5" endWidth="659px" startWidth="171px">
    <f:facet name="center"/>
    <f:facet name="start"/>
    <f:facet name="end">
    <af:panelGroupLayout layout="scroll" id="pgl2">
    <af:inputFile label="Select Image" id="if1" autoSubmit="true"
    valueChangeListener="#{ImageBean.uploadFileValueChangeEvent}"/>
    <af:commandButton actionListener="#{bindings.CreateInsert.execute}"
    text="Restart Load Image Process"
    disabled="#{!bindings.CreateInsert.enabled}"
    id="cb2"/>
    <af:commandButton actionListener="#{bindings.Commit.execute}"
    text="Save"
    disabled="#{!bindings.Commit.enabled}"
    id="cb3"/>
    <af:commandButton text="View" id="cb1"
    partialSubmit="true"
    unsecure="#{ImageBean.downloadButton}"
    action="#{image.downloadImage}"
    binding="#{image2.downloadButton}"/>
    </af:panelGroupLayout>
    </f:facet>
    <f:facet name="top"/>
    </af:panelStretchLayout>
    </f:facet>
    <f:facet name="start"/>
    <f:facet name="top">
    <af:panelStretchLayout id="psl4" startWidth="232px" endWidth="296px"
    bottomHeight="18px" topHeight="11px">
    <f:facet name="bottom"/>
    <f:facet name="center"/>
    <f:facet name="start">
    <af:panelFormLayout id="pfl1" labelAlignment="top">
    <f:facet name="footer"/>
    <af:inputText label="File from PC to be Transfered" id="it4"/>
    </af:panelFormLayout>
    </f:facet>
    <f:facet name="end">
    <af:panelFormLayout id="pfl2" labelAlignment="top" maxColumns="10">
    <f:facet name="footer">
    <af:inputText value="#{bindings.DocumentName.inputValue}"
    label="File Transfered to Database"
    required="#{bindings.DocumentName.hints.mandatory}"
    columns="50"
    rows="1"
    maximumLength="#{bindings.DocumentName.hints.precision}"
    shortDesc="#{bindings.DocumentName.hints.tooltip}"
    id="it5" simple="false">
    <f:validator binding="#{bindings.DocumentName.validator}"/>
    </af:inputText>
    </f:facet>
    </af:panelFormLayout>
    </f:facet>
    <f:facet name="top"/>
    </af:panelStretchLayout>
    </f:facet>
    </af:panelStretchLayout>
    </af:panelGroupLayout>
    </f:facet>
    </af:decorativeBox>
    </f:facet>
    </af:panelStretchLayout>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    and my log file is
    <ViewHandlerImpl> <_checkTimestamp> Apache Trinidad is running with time-stamp checking enabled. This should not be used in a production environment. See the org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION property in WEB-INF/web.xml
    <UIXEditableValue> <_isBeanValidationAvailable> A Bean Validation provider is not present, therefore bean validation is disabled
    the method am calling is
        public BlobDomain downloadImage() {
            FacesContext facesContext = null;
            OutputStream outputStream = null;
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            // get an ADF attributevalue from the ADF page definitions
            AttributeBinding attr = (AttributeBinding)bindings.getControlBinding("Documentimage");
            if (attr == null) {
                return null;
            // the value is a BlobDomain data type
            BlobDomain blob = (BlobDomain)attr.getInputValue();
            try { // copy hte data from the BlobDomain to the output stream
                IOUtils.copy(blob.getInputStream(), outputStream);
                // cloase the blob to release the recources
                blob.closeInputStream();
                // flush the outout stream
                outputStream.flush();
            } catch (IOException e) {
                // handle errors
                e.printStackTrace();
                FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");
                FacesContext.getCurrentInstance().addMessage(null, msg);
            return blob;
        }i get this error when clicking the button
    error when not able to download image
    <BeanHandler> <getStructure> Failed to build StructureDefinition for : sms4200.ImageBean
    <UIXEditableValue> <_isBeanValidationAvailable> A Bean Validation provider is not present, therefore bean validation is disabled
    Edited by: Tshifhiwa on 2012/06/03 10:53 AM
    Edited by: Tshifhiwa on 2012/06/03 10:56 AM
    Edited by: Tshifhiwa on 2012/06/03 10:57 AM

    hi i try to run your sample am geting this error
    Error 500--Internal Server Error
    oracle.jbo.DMLException: JBO-27200: JNDI failure. Unable to lookup Data Source at context jdbc/HRDS
         at oracle.jbo.server.DBTransactionImpl.lookupDataSource(DBTransactionImpl.java:1453)
         at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:329)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:203)
         at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolConnect(ApplicationPoolMessageHandler.java:600)
         at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:417)
         at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:8972)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4606)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2536)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2346)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3245)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:571)
         at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:234)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:504)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:499)
         at oracle.adf.model.bc4j.DCJboDataControl.initializeApplicationModule(DCJboDataControl.java:517)
         at oracle.adf.model.bc4j.DCJboDataControl.getApplicationModule(DCJboDataControl.java:867)
         at oracle.adf.model.binding.DCDataControl.setErrorHandler(DCDataControl.java:487)
         at oracle.jbo.uicli.binding.JUApplication.setErrorHandler(JUApplication.java:261)
         at oracle.adf.model.BindingContext.put(BindingContext.java:1318)
         at oracle.adf.model.binding.DCDataControlReference.getDataControl(DCDataControlReference.java:247)
         at oracle.adf.model.BindingContext.instantiateDataControl(BindingContext.java:1020)
         at oracle.adf.model.dcframe.DataControlFrameImpl.doFindDataControl(DataControlFrameImpl.java:1645)
         at oracle.adf.model.dcframe.DataControlFrameImpl.internalFindDataControl(DataControlFrameImpl.java:1514)
         at oracle.adf.model.dcframe.DataControlFrameImpl.findDataControl(DataControlFrameImpl.java:1474)
         at oracle.adf.model.BindingContext.internalFindDataControl(BindingContext.java:1150)
         at oracle.adf.model.BindingContext.get(BindingContext.java:1103)
         at oracle.adf.model.binding.DCParameter.evaluateValue(DCParameter.java:82)
         at oracle.adf.model.binding.DCParameter.getValue(DCParameter.java:111)
         at oracle.adf.model.binding.DCBindingContainer.getChildByName(DCBindingContainer.java:2748)
         at oracle.adf.model.binding.DCBindingContainer.internalGet(DCBindingContainer.java:2796)
         at oracle.adf.model.binding.DCExecutableBinding.get(DCExecutableBinding.java:115)
         at oracle.adf.model.binding.DCUtil.findSpelObject(DCUtil.java:329)
         at oracle.adf.model.binding.DCBindingContainer.evaluateParameterWithElCheck(DCBindingContainer.java:1478)
         at oracle.adf.model.binding.DCBindingContainer.findDataControl(DCBindingContainer.java:1608)
         at oracle.adf.model.binding.DCIteratorBinding.initDataControl(DCIteratorBinding.java:2542)
         at oracle.adf.model.binding.DCIteratorBinding.getDataControl(DCIteratorBinding.java:2477)
         at oracle.adf.model.binding.DCIteratorBinding.getAttributeDefs(DCIteratorBinding.java:3319)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.fetchAttrDefs(JUCtrlValueBinding.java:514)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDefs(JUCtrlValueBinding.java:465)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDef(JUCtrlValueBinding.java:541)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDef(JUCtrlValueBinding.java:531)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding$1JUAttributeDefHintsMap.(JUCtrlValueBinding.java:4104)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeHintsMap(JUCtrlValueBinding.java:4211)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.getHints(JUCtrlValueBinding.java:2564)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.internalGet(JUCtrlValueBinding.java:2389)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlAttrsBinding.internalGet(FacesCtrlAttrsBinding.java:275)
         at oracle.adf.model.binding.DCControlBinding.get(DCControlBinding.java:749)
         at javax.el.MapELResolver.getValue(MapELResolver.java:164)
         at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
         at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
         at com.sun.el.parser.AstValue.getValue(Unknown Source)
         at com.sun.el.ValueExpressionImpl.getValue(Unknown Source)
         at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
         at org.apache.myfaces.trinidad.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:73)
         at oracle.adfinternal.view.faces.renderkit.rich.LabelLayoutRenderer.getLabel(LabelLayoutRenderer.java:929)
         at oracle.adfinternal.view.faces.renderkit.rich.LabelLayoutRenderer.encodeAll(LabelLayoutRenderer.java:213)
         at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.encodeAll(LabeledInputRenderer.java:215)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer._encodeFormItem(PanelFormLayoutRenderer.java:1088)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer.access$100(PanelFormLayoutRenderer.java:50)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1604)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1523)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer._encodeChildren(PanelFormLayoutRenderer.java:420)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer.encodeAll(PanelFormLayoutRenderer.java:208)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:447)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$1500(PanelGroupLayoutRenderer.java:30)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:734)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:637)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:360)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeCenterFacet(PanelStretchLayoutRenderer.java:879)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeCenterPane(PanelStretchLayoutRenderer.java:1294)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeMiddlePanes(PanelStretchLayoutRenderer.java:351)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:316)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:2194)
         at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer.access$400(RegionRenderer.java:50)
         at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer$ChildEncoderCallback.processComponent(RegionRenderer.java:707)
         at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer$ChildEncoderCallback.processComponent(RegionRenderer.java:692)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
         at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
         at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
         at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer._encodeChildren(RegionRenderer.java:297)
         at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer.encodeAll(RegionRenderer.java:186)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at oracle.adf.view.rich.component.fragment.UIXRegion.encodeEnd(UIXRegion.java:323)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeCenterFacet(PanelStretchLayoutRenderer.java:879)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeCenterPane(PanelStretchLayoutRenderer.java:1294)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeMiddlePanes(PanelStretchLayoutRenderer.java:351)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:316)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
         at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
         at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:274)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
         at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
         at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1277)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
         at oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:91)
         at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:399)
         at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:350)
         at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
         at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
         at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:165)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1027)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:334)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:232)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:122)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: javax.naming.NameNotFoundException: While trying to lookup 'jdbc.HRDS' didn't find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/HRDS'
         at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
         at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:247)
         at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
         at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
         at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at oracle.jbo.server.DBTransactionImpl.lookupDataSource(DBTransactionImpl.java:1439)
         ... 190 more
    my connection.xml is
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <References xmlns="http://xmlns.oracle.com/adf/jndi">
    <Reference name="HRDS" className="oracle.jdeveloper.db.adapter.DatabaseProvider" credentialStoreKey="HRDS" xmlns="">
    <Factory className="oracle.jdeveloper.db.adapter.DatabaseProviderFactory"/>
    <RefAddresses>
    <StringRefAddr addrType="sid">
    <Contents>smsdev</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="subtype">
    <Contents>oraJDBC</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="port">
    <Contents>1521</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="hostname">
    <Contents>localhost</Contents>
    </StringRefAddr>
    <StringRefAddr addrType="user">
    <Contents>hr</Contents>
    </StringRefAddr>
    <SecureRefAddr addrType="password"/>
    <StringRefAddr addrType="oraDriverType">
    <Contents>thin</Contents>
    </StringRefAddr>
    </RefAddresses>
    </Reference>
    </References>
    Edited by: Tshifhiwa on 2012/06/04 2:20 PM

  • Retrieving Multiple Values from a table

    Dear Experts,
    Can anyone let me know how to retrieve multiple rows from a table using Oracle BPEL Database Adapter and assign it to a output variable?
    Regards,
    Pradeep.

    If the input XML Record is as follows
    Input xmlRecord:
    <EmployeeCollection>
    <Employee>
    <id>10</id>
    <lastName>Smith</lastName>
    </Employee>
    <Employee>
    <id>20</id>
    <lastName>Ram</lastName>
    </Employee>
    </EmployeeCollection>
    I'm getting the following output when used with either queryByExample or normal SELECT option with a WHERE condition
    <EmployeeCollection>
    <Employee>
    <id>10</id>
    <lastName>Smith</lastName>
    </Employee>
    </EmployeeCollection>
    Instead of all the records in the Employee table which meet the where condition?
    I NEED OUTPUT AS FOLLOWS:
    <EmployeeCollection>
    <Employee>
    <id>10</id>
    <lastName>Smith</lastName>
    </Employee>
    <Employee>
    <id>20</id>
    <lastName>Ram</lastName>
    </Employee>
    </EmployeeCollection>
    I'm using Transformation with for-each option
    Can some one help it is very urgent.
    Thanks & Regards,
    Murali Vikrala

  • How to retrieve multiple data from table and represent it in jsp page

    Hi
    The below JavaScript code is used to add row in the table when I want to add multiple row data into table for single entry no field.
      <html>  function addRow()
                i++;
                var newRow = document.all("tblGrid").insertRow();
                var oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='srno"+i+"' type='text' id='srno"+i+"' size=10>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='itmcd"+i+"' type='text' id='itmcd"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='itmnm"+i+"' type='text' id='itmnm"+i+"' size='15'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='indentqty"+i+"' type='text' id='indentqty"+i+"' size='10'>";
                oCell = newRow.insertCell();
                    oCell.innerHTML = "<input name='uom"+i+"' type='text' id='uom"+i+"' size='10'><input type='hidden' name='mcode"+i+"'id='mcode"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='packqty"+i+"' type='text' id='packqty"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='packuom"+i+"' type='text' id='packuom"+i+"' size='10'><input type='hidden' name='pack"+i+"' id='pack"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='rate"+i+"' type='text' id='rate"+i+"' size='10'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='dor"+i+"' type='text' id='dor"+i+"' size='0' onClick='"+putdate(this.name)+"'>";           
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='bccode"+i+"' type='text' id='bccode"+i+"' size='10'></td><input type='hidden' name='bcc"+i+"' id='bcc"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='cccode"+i+"' type='text' id='cccode"+i+"' size='10'></td><input type='hidden' name='ccc"+i+"' id='ccc"+i+"'>";
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input name='remark2"+i+"' type='text' id='remark2"+i+"' size='20'>";           
                oCell = newRow.insertCell();
                oCell.innerHTML = "<input type='button' value='Delete' onclick='removeRow(this);' />";
               // oCell = newRow.insertCell();
               // oCell.innerHTML = "<input type='button' value='Clear' onclick='clearRow(this);' />";
            }<html>  Then this data are send to the next Servlet for adding into two table.
    My header portion data are added into one table which added only one row in table. while footer section data are added into the no of rows in another table dependent on No. of
    Rows added into jsp page.
    Here is an code for that logic.
    <html>
    ArrayList<String> mucode = new ArrayList<String>();
                                ArrayList<Integer> serials = new ArrayList<Integer>();
                                ArrayList<Integer> apxrate = new ArrayList<Integer>();
                                ArrayList<Integer> srname = new ArrayList<Integer>();
                                ArrayList<String> itcode = new ArrayList<String>();
                                ArrayList<String> itname = new ArrayList<String>();
                                ArrayList<Integer> iqnty = new ArrayList<Integer>();
                                ArrayList<String> iuom = new ArrayList<String>();
                                ArrayList<Integer> pqnty = new ArrayList<Integer>();
                                ArrayList<String> puom1 = new ArrayList<String>();
                               ArrayList<Integer> arate = new ArrayList<Integer>();
                                ArrayList<String> rdate = new ArrayList<String>();
                                ArrayList<String> bcs = new ArrayList<String>();
                                ArrayList<String> ccs = new ArrayList<String>();
                                ArrayList<String> remarkss = new ArrayList<String>();
                                //ArrayList<Integer> qtyrecs = new ArrayList<Integer>();
                                //ArrayList<String> dors = new ArrayList<String>();
                                //ArrayList<String> remarks = new ArrayList<String>();
                     String entryn = request.getParameter("entryno");       
                        String rows = request.getParameter("rows");
                        out.println(rows);  
                        //String Entryno = request.getParameter("entryno");
                       // out.println(Entryno);
                      int entryno = 0,reqqty = 0,srno = 0,deprequest = 0,rowcount = 0;
                                if(!Entryno.equals("")){
                                        entryno = Integer.valueOf(Entryno);
                                if(!rows.equals("")){
                                        rowcount = Integer.valueOf(rows);
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("srno"+i)!=null){
                                                serials.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
                                                out.println(serials.size());
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("srno"+i)!=null){
                                                srname.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
                                out.println(srname.get(0));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("itmcd"+i)!=null){
                                                itcode.add(request.getParameter("itmcd"+i).trim());
                                        } //out.println(itcode.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("itmnm"+i)!=null){
                                                itname.add(request.getParameter("itmnm"+i).trim());
                                        }//out.println(itname.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("indentqty"+i)!=null){
                                                iqnty.add(Integer.valueOf(request.getParameter("indentqty"+i).trim()));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("uom"+i)!=null){
                                                iuom.add(request.getParameter("uom"+i).trim());
                                        }//out.println(iuom.get(i));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("mcode"+i)!=null){
                                                mucode.add(request.getParameter("mcode"+i).trim());
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("packqty"+i).equals("")){
                                          pqnty.add(0);
                                        }else
                                            pqnty.add(Integer.valueOf(request.getParameter("packqty"+i).trim()));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("pack"+i)!=null){
                                                puom1.add(request.getParameter("pack"+i).trim());
                                       }else
                                        puom1.add("");
                               for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("rate"+i).equals("")){                                     
                                            arate.add(0);
                                        }else
                                        arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));   
                     /* for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("rate"+i)!=null){
                                                arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));
                              for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("dor"+i)!=null){
                                                try{
                                                        rdate.add(dashdate.format(slashdate.parse(request.getParameter("dor"+i).trim())));
                                                }catch(ParseException p){p.printStackTrace();}
                                        }else
                                           { rdate.add("");}
                                   for(int i=1;i<=rowcount;i++){
                                 if(request.getParameter("bcc"+i)!=null){
                                                bcs.add(request.getParameter("bcc"+i).trim());
                                        }out.println(bcs.get(0));
                                for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("ccc"+i)!=null){
                                                ccs.add(request.getParameter("ccc"+i).trim());
                                        }out.println(ccs.get(0));
                                for(int i=1;i<=rowcount;i++){
                                    out.println("remark2");
                                        if(request.getParameter("remark2"+i)!=null){
                                                remarkss.add(request.getParameter("remark2"+i).trim());
                                        }out.println(remarkss.get(0));
                        ArrayList<String> Idate = new ArrayList<String>();
                        for(int i=1;i<=rowcount;i++){
                                        if(request.getParameter("dateindent"+i)!=null){
                                                try{
                                                        Idate.add(dashdate.format(dashdate.parse(request.getParameter("dateindent"+i).trim())));
                                                }catch(ParseException p){p.printStackTrace();}
                    String Rdate = dashdate.format(new java.util.Date());
                     String tdate = dashdate.format(new java.util.Date());    
                     // String Indentdate = dashdate.format(new java.util.Date());
                   //  String ApprovedT1 = dashdate.format(new java.util.Date());
                   //  String ApprovedT2 = dashdate.format(new java.util.Date());
                       // String ApprovedT1=" ";
                        //String ApprovedT2="";*/
                    String ApprovedT1= dashdate.format(new java.util.Date());
                   out.println (ApprovedT1);
                      String ApprovedT2=dashdate.format(new java.util.Date());
                       out.println(ApprovedT2);
                    String Indentdate=(dashdate.format(slashdate.parse(request.getParameter("dateindent").trim())));
                       out.println(Indentdate);
                        String Cocode ="BML001";  
                        out.println(Cocode);
                        String Deptcode = request.getParameter("dept1");
                        out.println(Deptcode);
                        String Empcode = request.getParameter("emp");
                        out.println(Empcode);
                        String Refno =request.getParameter("rtype"); 
                         out.println(Refno);
                        String Divcode = request.getParameter("todiv1");
                        out.println(Divcode);
                        String Usercode = "CIRIUS";    
                         String Whcode = request.getParameter("stor");
                        out.println(Whcode);
                        // String Itemgroupcode = request.getParameter("");
                         String Itemgroupcode ="120000";
                         out.println(Itemgroupcode);
                        String Supplytypecode = request.getParameter("stype");
                        out.println(Supplytypecode);
                        String Delcode = request.getParameter("deliverycode");
                        out.println(Delcode);
                        String Itemclass="WS";
                        out.println(Itemclass);
                        // String Itemclass = request.getParameter("iclass");
                       // out.println(Itemclass);
                        String unitcode = request.getParameter("uni");
                        out.println(unitcode);
                         String Todivcode = request.getParameter("todiv1");
                        out.println(Todivcode);
                        String Appxrate = request.getParameter("rate");
                        out.println(Appxrate);
                        String Srno = request.getParameter("srno");
                        out.println(Srno);                
                    /*    String Indqty = request.getParameter("indentqty");
                      out.println(Indqty);*/
                  String Itemcode = request.getParameter("itmcd");
                       out.println(Itemcode);
                       String Othersp = request.getParameter("remark1");
                        out.println(Othersp);
                        String Reqdt = request.getParameter("dor");
                        out.println(Reqdt);
                        String Munitcode = request.getParameter("mcode");
                        out.println(Munitcode);
                        String Packqty = request.getParameter("packqty");
                        out.println(Packqty);               
                        String Packuom = request.getParameter("pack");
                        out.println(Packuom);
                        String Remark2 = request.getParameter("remark2");
                        out.println(Remark2);
                        String BC = request.getParameter("bcc");
                        out.println(BC);
                        String CC = request.getParameter("ccc");
                        out.println(CC);
                        try{
                            st=connection.createStatement();
                            connection.setAutoCommit(false);
                            String sql="INSERT INTO PTXNINDHDR(COCODE,DEPTCODE,EMPCODE,APPROVEDT1,APPROVEDT2,INDDT,ENTRYNO,REFNO,REMARKS,DIVCODE,USERCODE,WHCODE,ITEMGROUPCODE,SUPTYPECODE,DELCODE,UNITCODE,TODIVCODE,ITEMCLASS)VALUES('"+Cocode+"','"+Deptcode+"','"+Empcode+"','"+ApprovedT1+"','"+ApprovedT2+"','"+Indentdate+"',"+Entryno+",'"+Refno+"','"+Othersp+"','"+Divcode+"','"+Usercode+"','"+Whcode+"','"+Itemgroupcode+"','"+Supplytypecode+"','"+Delcode+"','"+unitcode+"','"+Todivcode+"','"+Itemclass+"')";
                            out.println(sql);
                            st.addBatch(sql);
                            for(int i=0;i<serials.size();i++){
                                out.println("Inside the Statement");
                                String query3="test query for u";
                                out.println(query3);
                               String queryx="Insert into PTXNINDDTL(APXRATE,ENTRYNO,BRKNO,INDQTY,ITEMCODE,OTHERSPFCS,MUNITCODE,PACKQTY,PACKUOM,REMARKS,DIMSUBGRPCODE,DIMCODE,REQDT)VALUES("+arate.get(i)+","+entryno+","+srname.get(i)+","+iqnty.get(i)+","+itcode.get(i)+",'"+Othersp+"','"+mucode.get(i)+"',"+pqnty.get(i)+",'"+puom1.get(i)+"','"+remarkss.get(i)+"','"+bcs.get(i)+"','"+ccs.get(i)+"','"+rdate.get(i)+"')";
                               out.println(queryx);
                                st.addBatch(queryx);
                           int[] result=st.executeBatch();
                           connection.commit();
                           for(int k=0;k<result.length;k++)
                           out.println("rows updated by "+(k+1)+"insert sta:"+result[k]+"");
                        catch(BatchUpdateException bue)
                        out.println("error1;"+bue+"");
                        catch(SQLException sql)
                        out.println("error2;"+sql+"");
                        catch(Exception l)
                        out.println("error3;"+l+"");
    </html>
       Now I looking for to retrieve this footer section data available in multiple rows from footer table and present it in jsp page .
    I am finding difficulties in how to show this multiple row data for dynamic no of rows .i.e. variable no. of rows.
    I have able to show the data in Header portions of page in this ways
    here i am adding the part of code which shows the data from header part of table i.e from Header table
      <html>
    <h2 align="center"><b>Indent Preparation</b></h2>
        <div align="left">
            <table width="849" border="0" cellspacing="3" cellpadding="3" align="center">
                <tr>
                    <td ><div align="left"><b>Indent No.</b></div></td>
                    <td ><label>
                            <input name="indentno" type="text" id="indentno" size="15" value="" /><input type="hidden" name="no" id="no">
                    </label></td>
                    <td ><div align="center"><strong>Indent Date</strong></div></td>
                    <td ><label>
                            <div align="center">
                                <input name="dateindent" type="text" id="dateindent"value="<%=date1%>"/><input type="hidden" name="no" id="no">
                            </div>
                    </label></td>
                    <td> </td>
                    <td><div align="right"><strong>Entry No.</strong></div></td>
                     <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
            <td><input type="text" value="<%=hdrcode.get(3)%>" size="10"></td>
    <%}else{%>
                   <td><input type="text" name="entryno" id="entryno" value="<%=entryNo%>"/></td>
                             <%}%>
                            <div align="right"></div>
                </tr>
                <tr>
                    <td><b>Division</b></td>
                    <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
    <td><input type="text" value="<%=hdrdetails.get(9)%>" size="20"</td>
    <td><input type="hidden" name="div1" id="div1" value='<%=hdrcode.get(10)%>'></td>
    <%}else{%>
                   <td><input type="text" name="div" id="div" /></td>
                   <td><input type="hidden" name="div1" id="div1" /> </td>
              <%}%>
                    <td> </td>
                    <td> </td>
                    <td><div align="right"><strong>Unit</strong></div></td>
                   <%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
    <td><input type="text" value="<%=hdrdetails.get(14)%>" size="20"</td>
    <td><input type="hidden" name="uni" id="uni" value='<%=hdrcode.get(12)%>'></td>
    <%}else{%>
                   <td><input type="text" name="unit" id="unit" /></td>
                   <td><input type="hidden" name="uni" id="uni" /> </td>
              <%}%>
                </tr>
                <tr>
    </html>
      Any suggestion on any above works is highly appreciated.
    Thanks and regards
    harshal

    Too much code. It's also not well intented nor formatted. I don't see a question either or it got lost in that heap of unformatted code.
    I will only answer the question in the thread's subject:
    How to retrieve multiple data from table and represent it in jsp pageTo retrieve, make use of HttpServletRequest#getParameterValues() and/or #getParameter().
    To display, make use of JSTL's c:forEach.

  • Displaying image from database in report

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

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

  • Error while getting  image from database in SUP using ios?

    Hi All,
      Im developing native iOS application using sup 2.1.3 . Im getting error While retrieving  image from SUP database. Here i'm trying to get image from database and show in imageView.can any one help me how to fix this issue?
    In database image datatype is  'LONG Binary' .
    My table Schema:
    CREATE TABLE dba.ImagesTable (
    RowID INT NOT NULL,
    ImageName VARCHAR(20) NOT NULL,
    PhotoData LONG BINARY NOT NULL,
    IN SYSTEM
    ALTER TABLE dba.ImagesTable
      ADD CONSTRAINT ASA137 PRIMARY KEY CLUSTERED (RowID)
    ALTER TABLE dba.ImagesTable
      ADD CONSTRAINT ASA138 UNIQUE NONCLUSTERED (RowID)
    in Xcode:
                [SUP107SUP107DB synchronize];
                SUP107ImagesTable *imgTable =[[SUP107ImagesTable alloc]init];
                SUP107ImagesTableList *list =[SUP107ImagesTable findAll];
                SUP107ImagesTable * oneRecord =[list objectAtIndex:0];
                NSLog(@"rowId:%d---imageName:%@---photoData:%@---photoLenght:%d",oneRecord.rowID,oneRecord.imageName,oneRecord.photoData,oneRecord.photoDataLength);
                NSData *tempData =[[NSData alloc]init];
                SUPBigBinary *responseBinaryData = (SUPBigBinary *)oneRecord.photoData.value;
                @try {
                    [responseBinaryData openForWrite:[oneRecord.photoData length]];
                    [responseBinaryData write:tempData];
                @catch (NSException *exception) {
                    NSLog(@"exception: %@",[exception description]);
                UIImageView *imgView =[[UIImageView alloc] initWithFrame:CGRectMake(50,50,100,100)];
                [self.window addSubview:imgView];
                UIImage * tempImage =[UIImage imageWithData:tempData];
                imgView.image = tempImage;
                [responseBinaryData close];
    Error Log:
    2014-04-02 18:42:15.150 SUP102[2873:70b] rowId:1---imageName:Apple---photoData:SUPBigBinary: column=c pending=1 allow_pending_state=1 table=sup107_1_0_imagestable mbo=0x0 key=(null) ---photoLenght:90656
    Printing description of responseBinaryData:
    <OS_dispatch_data: data[0xc891b40] = { leaf, size = 90656, buf = 0x1213a000 }>
    2014-04-02 18:42:33.304 SUP102[2873:70b] -[OS_dispatch_data openForWrite:]: unrecognized selector sent to instance 0xc891b40
    2014-04-02 18:42:33.305 SUP102[2873:70b] exception: -[OS_dispatch_data openForWrite:]: unrecognized selector sent to instance 0xc891b40
    2014-04-02 18:42:33.305 SUP102[2873:70b] -[OS_dispatch_data close]: unrecognized selector sent to instance 0xc891b40
    2014-04-02 18:42:33.306 SUP102[2873:70b] [ERROR] [AppDelegate.m:497] NSInvalidArgumentException: -[OS_dispatch_data close]: unrecognized selector sent to instance 0xc891b40

    This thread talks about uploading image to SAP from a IOS device,Sending Image to SAP via iOS Native app (SUP 2.1.3)
    Midhun VP

Maybe you are looking for