添加注释

This commit is contained in:
myh 2023-10-07 19:57:03 +08:00
parent 5e032c11b4
commit 850b88dd97

View File

@ -11,10 +11,10 @@ public class CommonDao {
DataBaseUtil dataBaseUtil = new DataBaseUtil(); DataBaseUtil dataBaseUtil = new DataBaseUtil();
public int delete(Connection ct, PreparedStatement ps, ResultSet rs, public int delete(Connection ct, PreparedStatement ps, ResultSet rs,
String sql, Long id) { String sql, Long id) {
int flag; int flag;
try { try {
ct = dataBaseUtil.getConnection(); ct = dataBaseUtil.getConnection();
// FIXME: 未对传入sql语句检测可能有sql注入攻击
ps = ct.prepareStatement(sql); ps = ct.prepareStatement(sql);
ps.setLong(1, id); ps.setLong(1, id);
flag = ps.executeUpdate(); flag = ps.executeUpdate();