Code example for PreparedStatement

Methods: executeUpdate, setTimestamp

0
		PreparedStatement st = null;
 
		try { 
			conn = DbUtil.getConnection();
			st = conn.prepareStatement("delete from WB_LOG where LOG_DATE < ?");
			st.setTimestamp(1, new Timestamp(DateUtil.incDay(new Date(),
					-Var.getInt("webbuilder.task.logDays")).getTime())); 
			st.executeUpdate();
			LogUtil.message(context, start);
		} catch (Throwable e) {
			LogUtil.error(context, start, e);
		} finally { 
			DbUtil.closeStatement(st);
			DbUtil.closeConnection(conn);
		} 
	} 
}