Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. Part filePart=request.getPart("upload");
  2.  
  3. Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/photo","root","root");
  4. PreparedStatement ps=con.prepareStatement("insert into image values (?,?,?,?,?,?)");
  5.  
  6. InputStream fin=null;
  7. fin=filePart.getInputStream();
  8.  
  9. ps.setString(1,title);
  10. ps.setString(2,location);
  11. ps.setString(3,sale);
  12. ps.setString(4,market);
  13. ps.setString(5,area);
  14. ps.setBlob(6,fin);
  15.  
  16. int i=0;
  17. i=ps.executeUpdate();
  18. out.println(i+"Successfully updated");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement