This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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