A
Anythingcan
Hi gurus,
The following two sql statements delete all entries in a database.
1) DELETE FROM table_name;
2) DELETE FROM table_name WHERE column = column;
However, I would like my java code to only make use of option 2 so
that I can use it to delete all entries AND specific entry using a
PreparedStament, as follows:
con.prepareStatement("DELETE FROM table_name WHERE column = ?");
If I want to delete 'a', the code would be:
pstmt.setSring(1, "a");
pstmt.execute();
But what is the code to delete all the entries.
Is it the setRef(..) method? If yes, how? If not, how?
Thanks.
The following two sql statements delete all entries in a database.
1) DELETE FROM table_name;
2) DELETE FROM table_name WHERE column = column;
However, I would like my java code to only make use of option 2 so
that I can use it to delete all entries AND specific entry using a
PreparedStament, as follows:
con.prepareStatement("DELETE FROM table_name WHERE column = ?");
If I want to delete 'a', the code would be:
pstmt.setSring(1, "a");
pstmt.execute();
But what is the code to delete all the entries.
Is it the setRef(..) method? If yes, how? If not, how?
Thanks.