public CFSecurityISOCountryLanguageBuff lockBuff( CFSecurityAuthorization Authorization, CFSecurityISOCountryLanguagePKey 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 ISOLanguageId = PKey.getRequiredISOLanguageId(); String sql = "SELECT * FROM " + schema.getLowerDbSchemaName() + ".sp_lock_iso_cntrylng( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; 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++, ISOLanguageId); resultSet = stmtLockBuffByPKey.executeQuery(); if (resultSet.next()) { CFSecurityISOCountryLanguageBuff buff = unpackISOCountryLanguageResultSetToBuff(resultSet); if (resultSet.next()) { throw CFLib.getDefaultExceptionFactory() .newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response"); } 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 void deleteISOCountryLanguageByIdIdx( CFSecurityAuthorization Authorization, CFSecurityISOCountryLanguagePKey argKey) { deleteISOCountryLanguageByIdIdx( Authorization, argKey.getRequiredISOCountryId(), argKey.getRequiredISOLanguageId()); }