Online Hibernate Training just in Rs. 1000

One week online training in Hibernate ORM framework. Learn Hibernate Framework and enhance your skills. Best Online Hibernate training at 90% discount. Join Now!! Offer is valid Only for limited Period!!! Online Training Big Data and Hadoop Training Java Training  
 

how to retrieve image from mysql database using java and show it in HTML img tag ?

Ads

 
 

Share on Google+Share on Google+

Sujitha
how to retrieve image from mysql database using java and show it in HTML img tag ?
5 Answer(s)      4 years and 6 months ago
Posted in : Java Beginners

how to retrieve image from mysql database using java and show it in HTML img tag

Ads
View Answers

January 30, 2013 at 3:55 PM


hi friend,

you can use the following line of code for retrieving the image from database as :

InputStream is = rs.getBinaryStream(3);

Or, you can also use the following code as :

Blob blobImage = rs.getBlob(columnIndex);
InputStream is = image.getBinaryStream();


January 31, 2013 at 9:01 AM


Ya. I already seen that code. But I want to display it in HTML tag. How to do this? Thanks in advance.



January 31, 2013 at 9:07 AM


Ya. I already seen that code. But I want to display it in HTML img tag. How to do this? Thanks in advance.



January 31, 2013 at 9:07 AM


Ya. I already seen that code. But I want to display it in HTML img tag. How to do this? Thanks in advance.



January 31, 2013 at 9:07 AM


Ya. I already seen that code. But I want to display it in HTML img tag. How to do this? Thanks in advance.


Ads