I had uploaded the picture and saved the path into database..But I am not able to retrieve the picture..Path is gettable but image is not shown..Below is the code..Do suggest some help..
<%@ page import="java.Io.*,com.Oreilly.Servlet.*" %><%@ page import="java.Sql.*"%><%@ page import="java.Io.*"%><% try {String rno=(String)session.GetAttribute("reg_no"); String tname=null; String aname=null; String cname=null;Final int limit=1024*1024*1024; Class.ForName("oracle.Jdbc.Driver.OracleDriver"); Connection con=DriverManager.GetConnection("jdbc:oracle:thin:@127.0.0.1:1521:xe","anand","sethi"); int I=0; String saveDir=application.GetRealPath("photo"); File f=new File(saveDir); f.Mkdirs(); MultipartRequest mpr=new MultipartRequest(request,application.GetRealPath("photo"),limit); String s1=mpr.GetOriginalFileName("file"); String path=application.GetRealPath("photo"+""+s1); Statement st=con.CreateStatement(); I = st.ExecuteUpdate("update profile set p_path='"+path+"' where reg_no='"+rno+"'"); if(I==1) { out.Println("done"); } else out.Println("not done"); } catch(Exception e) { out.Print("in sql exception"+e); }%>-reply by R.A.Sethi



