public CFSecurityISOCountryCurrencyBuff lockBuff( CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyPKey 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(); short ISOCountryId = PKey.getRequiredISOCountryId(); short ISOCurrencyId = PKey.getRequiredISOCurrencyId(); final String sql = "CALL sp_lock_iso_cntryccy( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; 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.setShort(argIdx++, ISOCountryId); stmtLockBuffByPKey.setShort(argIdx++, ISOCurrencyId); resultSet = stmtLockBuffByPKey.executeQuery(); if (resultSet.next()) { CFSecurityISOCountryCurrencyBuff buff = unpackISOCountryCurrencyResultSetToBuff(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; } } }
protected CFSecurityISOCountryCurrencyBuff unpackISOCountryCurrencyResultSetToBuff( ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackISOCountryCurrencyResultSetToBuff"; int idxcol = 1; CFSecurityISOCountryCurrencyBuff buff = schema.getFactoryISOCountryCurrency().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(CFSecurityDb2LUWSchema.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(CFSecurityDb2LUWSchema.convertTimestampString(colString)); } idxcol++; } buff.setRequiredISOCountryId(resultSet.getShort(idxcol)); idxcol++; buff.setRequiredISOCurrencyId(resultSet.getShort(idxcol)); idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }
public CFSecurityISOCountryCurrencyBuff[] 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_iso_cntryccy_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<CFSecurityISOCountryCurrencyBuff> buffList = new LinkedList<CFSecurityISOCountryCurrencyBuff>(); while (resultSet.next()) { CFSecurityISOCountryCurrencyBuff buff = unpackISOCountryCurrencyResultSetToBuff(resultSet); buffList.add(buff); } int idx = 0; CFSecurityISOCountryCurrencyBuff[] retBuff = new CFSecurityISOCountryCurrencyBuff[buffList.size()]; Iterator<CFSecurityISOCountryCurrencyBuff> 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 deleteISOTimezone( CFSecurityAuthorization Authorization, CFSecurityISOTimezoneBuff Buff) { final String S_ProcName = "deleteISOTimezone"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); short ISOTimezoneId = Buff.getRequiredISOTimezoneId(); final String sql = "CALL sp_delete_isotz( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; 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.setShort(argIdx++, ISOTimezoneId); 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 CFSecurityISOCountryCurrencyBuff[] readAllDerived(CFSecurityAuthorization Authorization) { final String S_ProcName = "readAllDerived"; CFSecurityISOCountryCurrencyBuff[] buffArray; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } buffArray = readAllBuff(Authorization); return (buffArray); }
public CFSecurityISOCountryCurrencyBuff[] readDerivedByCountryIdx( CFSecurityAuthorization Authorization, short ISOCountryId) { final String S_ProcName = "readDerivedByCountryIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } CFSecurityISOCountryCurrencyBuff[] buffList = readBuffByCountryIdx(Authorization, ISOCountryId); return (buffList); }
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 String getSqlSelectISOCountryCurrencyDistinctClassCode() { if (S_sqlSelectISOCountryCurrencyDistinctClassCode == null) { S_sqlSelectISOCountryCurrencyDistinctClassCode = "SELECT " + "DISTINCT iccy.ClassCode " + "FROM " + schema.getLowerDbSchemaName() + ".iso_cntryccy AS iccy "; } return (S_sqlSelectISOCountryCurrencyDistinctClassCode); }
public String getSqlSelectISOTimezoneDistinctClassCode() { if (S_sqlSelectISOTimezoneDistinctClassCode == null) { S_sqlSelectISOTimezoneDistinctClassCode = "SELECT " + "DISTINCT itzn.ClassCode " + "FROM " + schema.getLowerDbSchemaName() + ".ISOTz AS itzn "; } return (S_sqlSelectISOTimezoneDistinctClassCode); }
public CFSecurityISOCountryCurrencyBuff readDerivedByIdIdx( CFSecurityAuthorization Authorization, short ISOCountryId, short ISOCurrencyId) { final String S_ProcName = "CFSecurityDb2LUWISOCountryCurrencyTable.readDerivedByIdIdx() "; CFSecurityISOCountryCurrencyBuff buff; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } buff = readBuffByIdIdx(Authorization, ISOCountryId, ISOCurrencyId); return (buff); }
public CFSecurityISOTimezoneBuff readDerivedByUTZNameIdx( CFSecurityAuthorization Authorization, String TZName) { final String S_ProcName = "CFSecurityDb2LUWISOTimezoneTable.readDerivedByUTZNameIdx() "; CFSecurityISOTimezoneBuff buff; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } buff = readBuffByUTZNameIdx(Authorization, TZName); return (buff); }
public CFSecurityISOTimezoneBuff readDerived( CFSecurityAuthorization Authorization, CFSecurityISOTimezonePKey PKey) { final String S_ProcName = "readDerived"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } CFSecurityISOTimezoneBuff buff; buff = readBuff(Authorization, PKey); return (buff); }
public CFSecurityISOCountryCurrencyBuff lockDerived( CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyPKey PKey) { final String S_ProcName = "lockDerived"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } CFSecurityISOCountryCurrencyBuff buff; buff = lockBuff(Authorization, PKey); return (buff); }
public String getSqlSelectISOCountryCurrencyBuff() { if (S_sqlSelectISOCountryCurrencyBuff == null) { S_sqlSelectISOCountryCurrencyBuff = "SELECT " + "iccy.ISOCountryId, " + "iccy.ISOCurrencyId, " + "iccy.Revision " + "FROM " + schema.getLowerDbSchemaName() + ".iso_cntryccy AS iccy "; } return (S_sqlSelectISOCountryCurrencyBuff); }
public CFSecurityCursor openISOTimezoneCursorByIso8601Idx( CFSecurityAuthorization Authorization, String Iso8601) { String sql = getSqlSelectISOTimezoneBuff() + "WHERE " + "itzn.Iso8601 = " + CFSecurityDb2LUWSchema.getQuotedString(Iso8601) + " " + "ORDER BY " + "itzn.ISOTimezoneId ASC"; CFSecurityCursor cursor = new CFSecurityDb2LUWCursor(Authorization, schema, sql); return (cursor); }
public CFSecurityISOTimezoneBuff[] readBuffByOffsetIdx( CFSecurityAuthorization Authorization, short TZHourOffset, short TZMinOffset) { final String S_ProcName = "readBuffByOffsetIdx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_read_isotz_by_offsetidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtReadBuffByOffsetIdx == null) { stmtReadBuffByOffsetIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByOffsetIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByOffsetIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByOffsetIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByOffsetIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByOffsetIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByOffsetIdx.setShort(argIdx++, TZHourOffset); stmtReadBuffByOffsetIdx.setShort(argIdx++, TZMinOffset); resultSet = stmtReadBuffByOffsetIdx.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 CFSecurityISOTimezoneBuff readBuffByUTZNameIdx( CFSecurityAuthorization Authorization, String TZName) { final String S_ProcName = "readBuffByUTZNameIdx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_read_isotz_by_utznameidx( ?, ?, ?, ?, ?" + ", " + "?" + " )"; if (stmtReadBuffByUTZNameIdx == null) { stmtReadBuffByUTZNameIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByUTZNameIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUTZNameIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByUTZNameIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByUTZNameIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUTZNameIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByUTZNameIdx.setString(argIdx++, TZName); resultSet = stmtReadBuffByUTZNameIdx.executeQuery(); if (resultSet.next()) { CFSecurityISOTimezoneBuff buff = unpackISOTimezoneResultSetToBuff(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 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 updateISOCountryCurrency( CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyBuff Buff) { final String S_ProcName = "updateISOCountryCurrency"; if ("ICCY".equals(Buff.getClassCode()) && (!schema.isSystemUser(Authorization))) { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Permission denied -- only system user can modify ISOCountryCurrency data"); } ResultSet resultSet = null; try { short ISOCountryId = Buff.getRequiredISOCountryId(); short ISOCurrencyId = Buff.getRequiredISOCurrencyId(); int Revision = Buff.getRequiredRevision(); Connection cnx = schema.getCnx(); final String sql = "CALL sp_update_iso_cntryccy( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " )"; 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++, "ICCY"); stmtUpdateByPKey.setShort(argIdx++, ISOCountryId); stmtUpdateByPKey.setShort(argIdx++, ISOCurrencyId); stmtUpdateByPKey.setInt(argIdx++, Revision); resultSet = stmtUpdateByPKey.executeQuery(); if (resultSet.next()) { CFSecurityISOCountryCurrencyBuff updatedBuff = unpackISOCountryCurrencyResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } 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(CFSecurityDb2LUWSchema.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(CFSecurityDb2LUWSchema.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); }
public void createISOTimezone( CFSecurityAuthorization Authorization, CFSecurityISOTimezoneBuff Buff) { final String S_ProcName = "createISOTimezone"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } ResultSet resultSet = null; try { String Iso8601 = Buff.getRequiredIso8601(); String TZName = Buff.getRequiredTZName(); short TZHourOffset = Buff.getRequiredTZHourOffset(); short TZMinOffset = Buff.getRequiredTZMinOffset(); String Description = Buff.getRequiredDescription(); boolean Visible = Buff.getRequiredVisible(); Connection cnx = schema.getCnx(); final String sql = "CALL sp_create_isotz( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " )"; if (stmtCreateByPKey == null) { stmtCreateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtCreateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, "ITZN"); stmtCreateByPKey.setString(argIdx++, Iso8601); stmtCreateByPKey.setString(argIdx++, TZName); stmtCreateByPKey.setShort(argIdx++, TZHourOffset); stmtCreateByPKey.setShort(argIdx++, TZMinOffset); stmtCreateByPKey.setString(argIdx++, Description); if (Visible) { stmtCreateByPKey.setString(argIdx++, "Y"); } else { stmtCreateByPKey.setString(argIdx++, "N"); } resultSet = stmtCreateByPKey.executeQuery(); if (resultSet.next()) { CFSecurityISOTimezoneBuff createdBuff = 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.setRequiredISOTimezoneId(createdBuff.getRequiredISOTimezoneId()); Buff.setRequiredIso8601(createdBuff.getRequiredIso8601()); Buff.setRequiredTZName(createdBuff.getRequiredTZName()); Buff.setRequiredTZHourOffset(createdBuff.getRequiredTZHourOffset()); Buff.setRequiredTZMinOffset(createdBuff.getRequiredTZMinOffset()); Buff.setRequiredDescription(createdBuff.getRequiredDescription()); Buff.setRequiredVisible(createdBuff.getRequiredVisible()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); Buff.setCreatedByUserId(createdBuff.getCreatedByUserId()); Buff.setCreatedAt(createdBuff.getCreatedAt()); Buff.setUpdatedByUserId(createdBuff.getUpdatedByUserId()); Buff.setUpdatedAt(createdBuff.getUpdatedAt()); } 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; } } }