<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="com.svg.DBCon"%>
<%@page import="java.io.FileOutputStream"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.io.File"%>
<%@page import="java.io.OutputStream"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
<table border="1" width="100%" height="836">
<tr>
<td width="33%" height="157"></td>
<td width="23%" height="157"></td>
<td width="44%" height="157"></td>
</tr>
<tr>
<td width="33%" height="216"></td>
<td width="23%" height="216" nowrap scope="col">
<%
int myid=Integer.parseInt(request.getParameter("id"));
Connection con=null;
try
{
DBCon db= new DBCon();
String sql=" select photo from photo where username='"+<%session.getAttribute("user")%>+"' and resumeid="+myid;
con=db.getCon();
con.setAutoCommit(false);
Statement st=con.createStatement();
ResultSet rs= st.executeQuery(sql);
while(rs.next())
{
byte[] imgData =rs.getBytes("photo");
response.setContentType("image/gif");
OutputStream o = response.getOutputStream();
o.write(imgData);
o.flush();
o.close();
}
}catch(Exception ex){ex.printStackTrace();}
finally
{
try
{
con.close();
}
catch(Exception ex){ex.printStackTrace();}
}
%>
</td>
<td width="44%" height="216"></td>
</tr>
<tr>
<td width="33%" height="445"></td>
<td width="23%" height="445"></td>
<td width="44%" height="445"></td>
</tr>
</table>
</body>
</html>