470,816 Members | 1,240 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,816 developers. It's quick & easy.

Retriving Image from database to jsp

Shanaj
51
hello

do u know how to retrive image from database and show the image in jsp page


retrive image using servlet or a java program
Jan 13 '07 #1
2 11030
r035198x
13,262 8TB
hello

do u know how to retrive image from database and show the image in jsp page


retrive image using servlet or a java program
[PHP]
<%
try {
byte[]data =retrieve the image binary data from the database
response.setContentType("image/gif"); //This line is very important
ServletOutputStream so = response.getOutputStream();
sout.write(data);
so.flush();
so.close();
} catch (Exception e) {
e.printStackTrace();
}

%>
[/PHP]

Let me know if you get an IllegalStateException with this.
Jan 13 '07 #2
Shanaj
51
[PHP]
<%
try {
byte[]data =retrieve the image binary data from the database
response.setContentType("image/gif"); //This line is very important
ServletOutputStream so = response.getOutputStream();
sout.write(data);
so.flush();
so.close();
} catch (Exception e) {
e.printStackTrace();
}

%>
[/PHP]

Let me know if you get an IllegalStateException with this.


Is it possible to add html code if I add this
Jan 13 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Eric Kincl | last post: by
2 posts views Thread by soma.gunasekaran | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.