Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DELETE data in a table
12-21-2010, 08:25 AM (This post was last modified: 12-21-2010 08:32 AM by tutorials4u.)
Post: #1
DELETE data in a table
Note:the MyConnection class was used to connect to the DB

PreparedStatement prepstmt;
try {
prepstmt = theConn.prepareStatement
("DELETE FROM tCust "+
" WHERE custId = ?");

prepstmt.setString(1,cust_id.getText());
prepstmt.executeUpdate();

theConn.commit();
prepstmt.close();
}
catch (Exception e) {
e.printStackTrace();
}
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:



Send your comments, Suggestions or Queries regarding this site at info@tutorials4u.net

Copyright © 2010 Tutorials4u.net All Rights Reserved