1 Reply Latest reply: Feb 6, 2013 1:57 PM by Murray9654 RSS

    Image resize in JSP stored in database.

    774597
      Hi,

      I am using Oracle Database.My images are stored in database in ORD Image format.

      ORD Image = > http://docs.oracle.com/cd/E11882_01/appdev.112/e10776/ch_imgref.htm

      I am fetching image and displaying in JSP.

      I want to resize image stored in database.

      I found Java Advanced Imgaing API and Looking for JSP implemntation example.

      http://www.oracle.com/technetwork/java/download-1-0-2-140451.html

      Any idea?

      OrdHttpUploadFile uploadPhoto = null;
      OracleResultSet ors=null;       
      OracleCallableStatement ocstmt = null; 
      OrdImage ordImage=null;
      OrdImage image=null;
      
      ///////////////// SQL Call to FETCH Record HERE 
           
      if(ors != null)
      {
           while(ors != null && ors.next()) {
      
           ordImage = (OrdImage)ors.getCustomDatum(3,OrdImage.getFactory());
           response.reset();
           response.setContentType("Cache-Control:must-revalidate,post-check,pre-check=0");
           response.setContentType(ordImage.getMimeType());
           handler.setPageContext(pageContext);
           handler.sendImage(ordImage);
           response.flushBuffer();
           }
      }
           - Thanks,
      Zohaib.

      Edited by: zohaib82 on Dec 25, 2012 11:02 PM
        • 1. Re: Image resize in JSP stored in database.
          Murray9654
          The java api is an api which is designed to do something. asking for jsp implementation for java api is meaningless. jave is a full fledged language and jsp uses scripting language to design GUI.

          for your problem, upload the image via a jsp page and get the image on server using servlet, use advanced imaging api in servlet to resige it and then store it in the database.