wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "How to load Image using iBatis?" Watch "How to load Image using iBatis?" New topic

How to load Image using iBatis?

Simpson Kumar
Ranch Hand

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

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41177
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 - my free Android networking tools app
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
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?
subject: How to load Image using iBatis?
Similar Threads
Image load on IE is getting problem
Display SQL Server Image Data Type
Inserting Image into Oracle.
Please help me complete steps to upload an image
Error while downloading Image from web site