我想知道,删除这一声明是否实际上删除了某些内容。 下面的法典总是执行。 是否删除了部分内容。 这样做的恰当方式是什么?
public Deleter(String pname, String pword) {
try {
PreparedStatement createPlayer = conn.prepareStatement("DELETE FROM players WHERE P_Name= "+ pname +" AND P_Word= " + pword + " ");
createPlayer.execute();
if(createPlayer.execute()==true){
JOptionPane.showMessageDialog(null, "Player successfully deleted!");
}else{
JOptionPane.showMessageDialog(null, "Player does not exist!", "notdeleted", JOptionPane.ERROR_MESSAGE);
}
} catch (Exception e) {
}
}