public void del(Integer empId, String yearMonth) {
Connection conn=DBUtil.getInstance().getConn();
PreparedStatement pstmt=null;
try {
pstmt=conn.prepareStatement("delete from t_salary where emp_id=? and year_month=?");
pstmt.setInt(1, empId);
pstmt.setString(2, yearMonth);
pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
throw new DataAcessException("工资信息删除失败!!!");
}
finally{
DBUtil.getInstance().release(conn, pstmt, null);
}
}总是select 语句总是不起作用,要删除的记录删除不了,不懂的哪里错了,郁闷呐。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货