• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

How to load Image using iBatis?

 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In our application we have to display multiple images on a JSP, and these images are already stored in SQL Server Database.

I can read that Image by JDBC code very simple. Here is the Template



From ResultSet object we can read InputStream object and by using this we can write image on JSP.

My question is there any possibilities to get the InputStream object as Image?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The javax.imageio.ImageIO.read method can transform an InputStream into a BufferedImage (which is a more useful subclass of Image), provided that the image is a GIF, BMP, JPEG or PNG.
 
Simpson Kumar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Ulf for quick reply..

Can we retrieve that object from through iBATIS?

Say for example, I have an object called ImageVO and it contains InputStream (private InputStream imageStream as instance variable and from iBATIS query

can we retrieve InputStream object?
reply
    Bookmark Topic Watch Topic
  • New Topic