public Map<String, String> updateTask(String taskStatus) { Map<String, String> resultMap = new HashMap<String, String>(); String status = "E"; String message = null; XxntcCsCalendarActivitiesEOVOImpl vo = getXxntcCsCalendarActivitiesEOVO2Update(); Row row = vo.getCurrentRow(); Date startTime = (Date) row.getAttribute("StartTime"); Date endTime = (Date) row.getAttribute("EndTime"); Number incidentId = (Number) row.getAttribute("IncidentId"); Number resourceId = (Number) row.getAttribute("ResourceId"); _logger.warning("Before Calling API"); _logger.warning("taskStatus:" + taskStatus.toString()); _logger.warning("startTime:" + startTime.toString()); _logger.warning("endTime:" + endTime.toString()); _logger.warning("incidentId:" + incidentId.toString()); _logger.warning("resourceId:" + resourceId.toString()); CallableStatement cs = null; String statement = "BEGIN XXNTC_CALENDAR_PKG.SCHEDULE_SR_PRC(?, ?, ?, ?, ?, ?, ?); END;"; try { cs = getDBTransaction().createCallableStatement(statement, 0); cs.registerOutParameter(6, Types.VARCHAR); cs.registerOutParameter(7, Types.VARCHAR); cs.setString(1, taskStatus); cs.setDate(2, startTime.dateValue()); cs.setDate(3, endTime.dateValue()); cs.setInt(4, incidentId.intValue()); cs.setLong(5, resourceId.longValue()); cs.executeUpdate(); status = cs.getString(6); message = cs.getString(7); } catch (SQLException e) { _logger.severe("Sql Exception during statement call", e); } finally { try { if (cs != null) cs.close(); } catch (SQLException e) { _logger.severe("Sql Exception While Closing Callable Statement", e); } } resultMap.put("x_status", status); resultMap.put("x_error_message", message); _logger.warning("After API is called"); _logger.warning("x_status:" + status); _logger.warning("x_error_message:" + message); return resultMap; }
/** * Sets <code>value</code> as attribute value for DEPARTMENT_ID using the alias name DepartmentId. * * @param value value to set the DEPARTMENT_ID */ public void setDepartmentId(Number value) { // set the department identifier setAttributeInternal(DEPARTMENTID, value); // set employee's commission based on employee's department try { // check for Sales department if (value != null && SALES_DEPARTMENT_ID == value.intValue()) { // if the commission has not been set yet if (this.getCommissionPct() == null) { // set commission to default this.setCommissionPct(new Number(DEFAULT_COMMISSION)); } } else { // clear commission for non Sales department this.setCommissionPct(null); } } catch (SQLException e) { // log the exception LOGGER.severe(e); } }
public String getAvaliableViews(Number resourceId, java.sql.Date activeDate) { String avaliableViews = null; CallableStatement cs = null; String statement = "BEGIN ? := XXNTC_CALENDAR_PKG.GET_AVAILABLE_CALENDAR_VIEWS (?, ?); END;"; try { cs = getDBTransaction().createCallableStatement(statement, 0); cs.registerOutParameter(1, Types.VARCHAR); cs.setInt(2, resourceId.intValue()); cs.setDate(3, activeDate); cs.executeUpdate(); avaliableViews = cs.getString(1); } catch (SQLException e) { _logger.severe("SQL Exception getAvaliableViews", e); } finally { try { if (cs != null) { cs.close(); } } catch (SQLException e) { _logger.severe("SQL Exception getAvaliableViews", e); } } return avaliableViews; }