Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Part filePart=request.getPart("upload");
- Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/photo","root","root");
- PreparedStatement ps=con.prepareStatement("insert into image values (?,?,?,?,?,?)");
- InputStream fin=null;
- fin=filePart.getInputStream();
- ps.setString(1,title);
- ps.setString(2,location);
- ps.setString(3,sale);
- ps.setString(4,market);
- ps.setString(5,area);
- ps.setBlob(6,fin);
- int i=0;
- i=ps.executeUpdate();
- out.println(i+"Successfully updated");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement