Win a copy of Functional Reactive Programming this week in the Other Languages forum!
    Bookmark Topic Watch Topic
  • New Topic

updating record

 
Nitin Belaram
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please suggest me how to update record on basic of id in servclet and jsp
 
rmail kumar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Report post to moderator
Class.forName("com.mysql.jdbc.Driver");
con =DriverManager.getConnection
("jdbc:mysql://192.168.10.59:3306/example",
"root", "root");
ps = con.prepareStatement("update servlet set
name = ? where id = ?");
ps.setInt(2, id);
ps.setString(1, name);
ps.executeUpdate();
 
    Bookmark Topic Watch Topic
  • New Topic