java - How to print sql result without executing the sql statement? -
i have sql statement delete row according id , area. can system.out.println statement without executing statement itself? want sure deleting correct.
here sample statement:
preparedstatement ps = db.getpreparedstatement("delete tbl_traininglinks training_title in ('"+vwarnid+"')"); int i=ps.executeupdate();
i've noticed question answered in comments add may relevant, depending on how application used.
if use select
, wait user verification before use delete
, data in table might changed in meantime , can end deleting rows didn't in select
statement , user did not verify deletion. might happen if display results of select
statement , delete immediately, chance smaller.
instead, recommend use select
, after user verifies deletion build delete
sql command uses keys of rows received in select
statement. way delete user verified deletion.
Comments
Post a Comment