protected CFSecuritySecFormBuff unpackSecFormResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackSecFormResultSetToBuff"; int idxcol = 1; CFSecuritySecFormBuff buff = schema.getFactorySecForm().newBuff(); { String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedByUserId(null); } else { buff.setCreatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedAt(null); } else { buff.setCreatedAt(CFCrmDb2LUWSchema.convertTimestampString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedByUserId(null); } else { buff.setUpdatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedAt(null); } else { buff.setUpdatedAt(CFCrmDb2LUWSchema.convertTimestampString(colString)); } idxcol++; } buff.setRequiredClusterId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredSecFormId(resultSet.getInt(idxcol)); idxcol++; buff.setRequiredSecAppId(resultSet.getInt(idxcol)); idxcol++; buff.setRequiredJEEServletMapName(resultSet.getString(idxcol)); idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }
public CFSecuritySecFormBuff lockBuff( CFSecurityAuthorization Authorization, CFSecuritySecFormPKey PKey) { final String S_ProcName = "lockBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); long ClusterId = PKey.getRequiredClusterId(); int SecFormId = PKey.getRequiredSecFormId(); final String sql = "CALL sp_lock_secform( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtLockBuffByPKey == null) { stmtLockBuffByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtLockBuffByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtLockBuffByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtLockBuffByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtLockBuffByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtLockBuffByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtLockBuffByPKey.setLong(argIdx++, ClusterId); stmtLockBuffByPKey.setInt(argIdx++, SecFormId); resultSet = stmtLockBuffByPKey.executeQuery(); if (resultSet.next()) { CFSecuritySecFormBuff buff = unpackSecFormResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public CFSecurityISOTimezoneBuff[] readAllBuff(CFSecurityAuthorization Authorization) { final String S_ProcName = "readAllBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_read_isotz_all( ?, ?, ?, ?, ? )"; if (stmtReadAllBuff == null) { stmtReadAllBuff = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadAllBuff.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadAllBuff.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadAllBuff.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadAllBuff.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadAllBuff.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); resultSet = stmtReadAllBuff.executeQuery(); List<CFSecurityISOTimezoneBuff> buffList = new LinkedList<CFSecurityISOTimezoneBuff>(); while (resultSet.next()) { CFSecurityISOTimezoneBuff buff = unpackISOTimezoneResultSetToBuff(resultSet); buffList.add(buff); } int idx = 0; CFSecurityISOTimezoneBuff[] retBuff = new CFSecurityISOTimezoneBuff[buffList.size()]; Iterator<CFSecurityISOTimezoneBuff> iter = buffList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public void deleteSecForm(CFSecurityAuthorization Authorization, CFSecuritySecFormBuff Buff) { final String S_ProcName = "deleteSecForm"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); long ClusterId = Buff.getRequiredClusterId(); int SecFormId = Buff.getRequiredSecFormId(); final String sql = "CALL sp_delete_secform( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " )"; if (stmtDeleteByPKey == null) { stmtDeleteByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtDeleteByPKey.setLong(argIdx++, ClusterId); stmtDeleteByPKey.setInt(argIdx++, SecFormId); stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision()); ; resultSet = stmtDeleteByPKey.executeQuery(); if (resultSet.next()) { int deleteFlag = resultSet.getInt(1); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } } else { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Expected 1 record result set to be returned by delete, not 0 rows"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public CFSecurityISOTimezoneBuff[] readAllDerived(CFSecurityAuthorization Authorization) { final String S_ProcName = "readAllDerived"; CFSecurityISOTimezoneBuff[] buffArray; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } buffArray = readAllBuff(Authorization); return (buffArray); }
public CFSecurityISOTimezoneBuff[] readDerivedByIso8601Idx( CFSecurityAuthorization Authorization, String Iso8601) { final String S_ProcName = "readDerivedByIso8601Idx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } CFSecurityISOTimezoneBuff[] buffList = readBuffByIso8601Idx(Authorization, Iso8601); return (buffList); }
public CFSecuritySecFormBuff[] readDerivedBySecAppIdx( CFSecurityAuthorization Authorization, long ClusterId, int SecAppId) { final String S_ProcName = "readDerivedBySecAppIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } CFSecuritySecFormBuff[] buffList = readBuffBySecAppIdx(Authorization, ClusterId, SecAppId); return (buffList); }
public CFSecuritySecFormBuff readDerivedByIdIdx( CFSecurityAuthorization Authorization, long ClusterId, int SecFormId) { final String S_ProcName = "CFCrmDb2LUWSecFormTable.readDerivedByIdIdx() "; CFSecuritySecFormBuff buff; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } buff = readBuffByIdIdx(Authorization, ClusterId, SecFormId); return (buff); }
public void deleteISOTimezoneByOffsetIdx( CFSecurityAuthorization Authorization, short argTZHourOffset, short argTZMinOffset) { final String S_ProcName = "deleteISOTimezoneByOffsetIdx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_delete_isotz_by_offsetidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtDeleteByOffsetIdx == null) { stmtDeleteByOffsetIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByOffsetIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByOffsetIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByOffsetIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByOffsetIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByOffsetIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtDeleteByOffsetIdx.setShort(argIdx++, argTZHourOffset); stmtDeleteByOffsetIdx.setShort(argIdx++, argTZMinOffset); resultSet = stmtDeleteByOffsetIdx.executeQuery(); if (resultSet.next()) { int deleteFlag = resultSet.getInt(1); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } } else { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Expected 1 record result set to be returned by delete, not 0 rows"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public String getSqlSelectSecFormDistinctClassCode() { if (S_sqlSelectSecFormDistinctClassCode == null) { S_sqlSelectSecFormDistinctClassCode = "SELECT " + "DISTINCT sfrm.ClassCode " + "FROM " + schema.getLowerDbSchemaName() + ".SecForm AS sfrm "; } return (S_sqlSelectSecFormDistinctClassCode); }
public CFSecurityISOTimezoneBuff lockDerived( CFSecurityAuthorization Authorization, CFSecurityISOTimezonePKey PKey) { final String S_ProcName = "lockDerived"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } CFSecurityISOTimezoneBuff buff; buff = lockBuff(Authorization, PKey); return (buff); }
public CFSecurityISOTimezoneBuff readDerivedByUTZNameIdx( CFSecurityAuthorization Authorization, String TZName) { final String S_ProcName = "CFCrmDb2LUWISOTimezoneTable.readDerivedByUTZNameIdx() "; CFSecurityISOTimezoneBuff buff; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } buff = readBuffByUTZNameIdx(Authorization, TZName); return (buff); }
public String getSqlSelectISOTimezoneDistinctClassCode() { if (S_sqlSelectISOTimezoneDistinctClassCode == null) { S_sqlSelectISOTimezoneDistinctClassCode = "SELECT " + "DISTINCT itzn.ClassCode " + "FROM " + schema.getLowerDbSchemaName() + ".ISOTz AS itzn "; } return (S_sqlSelectISOTimezoneDistinctClassCode); }
public CFSecurityCursor openISOTimezoneCursorByIso8601Idx( CFSecurityAuthorization Authorization, String Iso8601) { String sql = getSqlSelectISOTimezoneBuff() + "WHERE " + "itzn.Iso8601 = " + CFCrmDb2LUWSchema.getQuotedString(Iso8601) + " " + "ORDER BY " + "itzn.ISOTimezoneId ASC"; CFCrmCursor cursor = new CFCrmDb2LUWCursor(Authorization, schema, sql); return (cursor); }
public CFSecuritySecFormBuff readBuffByIdIdx( CFSecurityAuthorization Authorization, long ClusterId, int SecFormId) { final String S_ProcName = "readBuffByIdIdx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_read_secform_by_ididx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtReadBuffByIdIdx == null) { stmtReadBuffByIdIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByIdIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByIdIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByIdIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByIdIdx.setLong(argIdx++, ClusterId); stmtReadBuffByIdIdx.setInt(argIdx++, SecFormId); resultSet = stmtReadBuffByIdIdx.executeQuery(); if (resultSet.next()) { CFSecuritySecFormBuff buff = unpackSecFormResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public CFSecuritySecFormBuff[] readBuffBySecAppIdx( CFSecurityAuthorization Authorization, long ClusterId, int SecAppId) { final String S_ProcName = "readBuffBySecAppIdx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_read_secform_by_secappidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtReadBuffBySecAppIdx == null) { stmtReadBuffBySecAppIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffBySecAppIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffBySecAppIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffBySecAppIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffBySecAppIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffBySecAppIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffBySecAppIdx.setLong(argIdx++, ClusterId); stmtReadBuffBySecAppIdx.setInt(argIdx++, SecAppId); resultSet = stmtReadBuffBySecAppIdx.executeQuery(); List<CFSecuritySecFormBuff> buffList = new LinkedList<CFSecuritySecFormBuff>(); while (resultSet.next()) { CFSecuritySecFormBuff buff = unpackSecFormResultSetToBuff(resultSet); buffList.add(buff); } int idx = 0; CFSecuritySecFormBuff[] retBuff = new CFSecuritySecFormBuff[buffList.size()]; Iterator<CFSecuritySecFormBuff> iter = buffList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public String getSqlSelectSecFormBuff() { if (S_sqlSelectSecFormBuff == null) { S_sqlSelectSecFormBuff = "SELECT " + "sfrm.ClusterId, " + "sfrm.SecFormId, " + "sfrm.SecAppId, " + "sfrm.JEEServletMapName, " + "sfrm.Revision " + "FROM " + schema.getLowerDbSchemaName() + ".SecForm AS sfrm "; } return (S_sqlSelectSecFormBuff); }
public String getSqlSelectISOTimezoneBuff() { if (S_sqlSelectISOTimezoneBuff == null) { S_sqlSelectISOTimezoneBuff = "SELECT " + "itzn.ISOTimezoneId, " + "itzn.Iso8601, " + "itzn.TZName, " + "itzn.TZHourOffset, " + "itzn.TZMinOffset, " + "itzn.Description, " + "itzn.Visible, " + "itzn.Revision " + "FROM " + schema.getLowerDbSchemaName() + ".ISOTz AS itzn "; } return (S_sqlSelectISOTimezoneBuff); }
public void updateISOTimezone( CFSecurityAuthorization Authorization, CFSecurityISOTimezoneBuff Buff) { final String S_ProcName = "updateISOTimezone"; if ("ITZN".equals(Buff.getClassCode()) && (!schema.isSystemUser(Authorization))) { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Permission denied -- only system user can modify ISOTimezone data"); } ResultSet resultSet = null; try { short ISOTimezoneId = Buff.getRequiredISOTimezoneId(); String Iso8601 = Buff.getRequiredIso8601(); String TZName = Buff.getRequiredTZName(); short TZHourOffset = Buff.getRequiredTZHourOffset(); short TZMinOffset = Buff.getRequiredTZMinOffset(); String Description = Buff.getRequiredDescription(); boolean Visible = Buff.getRequiredVisible(); int Revision = Buff.getRequiredRevision(); Connection cnx = schema.getCnx(); final String sql = "CALL sp_update_isotz( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " )"; if (stmtUpdateByPKey == null) { stmtUpdateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtUpdateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtUpdateByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtUpdateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtUpdateByPKey.setString(argIdx++, "ITZN"); stmtUpdateByPKey.setShort(argIdx++, ISOTimezoneId); stmtUpdateByPKey.setString(argIdx++, Iso8601); stmtUpdateByPKey.setString(argIdx++, TZName); stmtUpdateByPKey.setShort(argIdx++, TZHourOffset); stmtUpdateByPKey.setShort(argIdx++, TZMinOffset); stmtUpdateByPKey.setString(argIdx++, Description); if (Visible) { stmtUpdateByPKey.setString(argIdx++, "Y"); } else { stmtUpdateByPKey.setString(argIdx++, "N"); } stmtUpdateByPKey.setInt(argIdx++, Revision); resultSet = stmtUpdateByPKey.executeQuery(); if (resultSet.next()) { CFSecurityISOTimezoneBuff updatedBuff = unpackISOTimezoneResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredIso8601(updatedBuff.getRequiredIso8601()); Buff.setRequiredTZName(updatedBuff.getRequiredTZName()); Buff.setRequiredTZHourOffset(updatedBuff.getRequiredTZHourOffset()); Buff.setRequiredTZMinOffset(updatedBuff.getRequiredTZMinOffset()); Buff.setRequiredDescription(updatedBuff.getRequiredDescription()); Buff.setRequiredVisible(updatedBuff.getRequiredVisible()); Buff.setRequiredRevision(updatedBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public void updateSecForm(CFSecurityAuthorization Authorization, CFSecuritySecFormBuff Buff) { final String S_ProcName = "updateSecForm"; if ("SFRM".equals(Buff.getClassCode()) && (!schema.isClusterUser(Authorization, Buff.getRequiredClusterId(), "UpdateSecForm"))) { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Permission denied -- User not part of SecGroup UpdateSecForm"); } ResultSet resultSet = null; try { long ClusterId = Buff.getRequiredClusterId(); int SecFormId = Buff.getRequiredSecFormId(); int SecAppId = Buff.getRequiredSecAppId(); String JEEServletMapName = Buff.getRequiredJEEServletMapName(); int Revision = Buff.getRequiredRevision(); Connection cnx = schema.getCnx(); final String sql = "CALL sp_update_secform( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " )"; if (stmtUpdateByPKey == null) { stmtUpdateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtUpdateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtUpdateByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtUpdateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtUpdateByPKey.setString(argIdx++, "SFRM"); stmtUpdateByPKey.setLong(argIdx++, ClusterId); stmtUpdateByPKey.setInt(argIdx++, SecFormId); stmtUpdateByPKey.setInt(argIdx++, SecAppId); stmtUpdateByPKey.setString(argIdx++, JEEServletMapName); stmtUpdateByPKey.setInt(argIdx++, Revision); resultSet = stmtUpdateByPKey.executeQuery(); if (resultSet.next()) { CFSecuritySecFormBuff updatedBuff = unpackSecFormResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredSecAppId(updatedBuff.getRequiredSecAppId()); Buff.setRequiredJEEServletMapName(updatedBuff.getRequiredJEEServletMapName()); Buff.setRequiredRevision(updatedBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
protected CFSecurityISOTimezoneBuff unpackISOTimezoneResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackISOTimezoneResultSetToBuff"; int idxcol = 1; CFSecurityISOTimezoneBuff buff = schema.getFactoryISOTimezone().newBuff(); { String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedByUserId(null); } else { buff.setCreatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedAt(null); } else { buff.setCreatedAt(CFCrmDb2LUWSchema.convertTimestampString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedByUserId(null); } else { buff.setUpdatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedAt(null); } else { buff.setUpdatedAt(CFCrmDb2LUWSchema.convertTimestampString(colString)); } idxcol++; } buff.setRequiredISOTimezoneId(resultSet.getShort(idxcol)); idxcol++; buff.setRequiredIso8601(resultSet.getString(idxcol)); idxcol++; buff.setRequiredTZName(resultSet.getString(idxcol)); idxcol++; buff.setRequiredTZHourOffset(resultSet.getShort(idxcol)); idxcol++; buff.setRequiredTZMinOffset(resultSet.getShort(idxcol)); idxcol++; buff.setRequiredDescription(resultSet.getString(idxcol)); idxcol++; buff.setRequiredVisible(("Y".equals(resultSet.getString(idxcol)) ? true : false)); idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }