File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Application Frameworks and the fly likes How to load Image using iBatis? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "How to load Image using iBatis?" Watch "How to load Image using iBatis?" New topic
Author

How to load Image using iBatis?

Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 260
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?


Thanks,
Kumar
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
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.


Ping & DNS - updated with new look and Ping home screen widget
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 260
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to load Image using iBatis?
 
Similar Threads
Please help me complete steps to upload an image
Error while downloading Image from web site
Image load on IE is getting problem
Display SQL Server Image Data Type
Inserting Image into Oracle.