public void deleteISOCountryCurrencyByCurrencyIdx(
     CFSecurityAuthorization Authorization, short argISOCurrencyId) {
   final String S_ProcName = "deleteISOCountryCurrencyByCurrencyIdx";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql = "exec sp_delete_iso_cntryccy_by_currencyidx ?, ?, ?, ?, ?" + ", " + "?";
     if (stmtDeleteByCurrencyIdx == null) {
       stmtDeleteByCurrencyIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtDeleteByCurrencyIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByCurrencyIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtDeleteByCurrencyIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtDeleteByCurrencyIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByCurrencyIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtDeleteByCurrencyIdx.setShort(argIdx++, argISOCurrencyId);
     Object stuff = null;
     boolean moreResults = stmtDeleteByCurrencyIdx.execute();
     while (stuff == null) {
       try {
         moreResults = stmtDeleteByCurrencyIdx.getMoreResults();
       } catch (SQLException e) {
         throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
       }
       if (moreResults) {
         try {
           stuff = stmtDeleteByCurrencyIdx.getResultSet();
         } catch (SQLException e) {
         }
       } else if (-1 == stmtDeleteByCurrencyIdx.getUpdateCount()) {
         break;
       }
     }
   } 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 deleteURLProtocolByIsSecureIdx(
     CFSecurityAuthorization Authorization, boolean argIsSecure) {
   final String S_ProcName = "deleteURLProtocolByIsSecureIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     final String sql =
         "CALL sp_delete_urlproto_by_issecureidx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
     if (stmtDeleteByIsSecureIdx == null) {
       stmtDeleteByIsSecureIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtDeleteByIsSecureIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByIsSecureIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtDeleteByIsSecureIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtDeleteByIsSecureIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByIsSecureIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     if (argIsSecure) {
       stmtDeleteByIsSecureIdx.setString(argIdx++, "Y");
     } else {
       stmtDeleteByIsSecureIdx.setString(argIdx++, "N");
     }
     resultSet = stmtDeleteByIsSecureIdx.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 void deleteAccessFrequency(
      CFSecurityAuthorization Authorization, CFBamAccessFrequencyBuff Buff) {
    final String S_ProcName = "deleteAccessFrequency";
    ResultSet resultSet = null;
    try {
      Connection cnx = schema.getCnx();
      short Id = Buff.getRequiredId();

      final String sql = "CALL sp_delete_accfreq( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )";
      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++, Id);
      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 CFSecuritySecAppBuff lockBuff(
     CFSecurityAuthorization Authorization, CFSecuritySecAppPKey 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 SecAppId = PKey.getRequiredSecAppId();
     String sql = "exec sp_lock_secapp ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?";
     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++, SecAppId);
     resultSet = stmtLockBuffByPKey.executeQuery();
     if (resultSet.next()) {
       CFSecuritySecAppBuff buff = unpackSecAppResultSetToBuff(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 CFSecurityISOCountryCurrencyBuff readBuff(
     CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyPKey PKey) {
   final String S_ProcName = "readBuff";
   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();
     String sql = "{ call sp_read_iso_cntryccy( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ) }";
     if (stmtReadBuffByPKey == null) {
       stmtReadBuffByPKey = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByPKey.setShort(argIdx++, ISOCountryId);
     stmtReadBuffByPKey.setShort(argIdx++, ISOCurrencyId);
     resultSet = stmtReadBuffByPKey.executeQuery();
     if ((resultSet != null) && 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;
     }
   }
 }
 public CFInternetURLProtocolBuff[] readBuffByIsSecureIdx(
     CFSecurityAuthorization Authorization, boolean IsSecure) {
   final String S_ProcName = "readBuffByIsSecureIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     final String sql = "CALL sp_read_urlproto_by_issecureidx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
     if (stmtReadBuffByIsSecureIdx == null) {
       stmtReadBuffByIsSecureIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByIsSecureIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByIsSecureIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByIsSecureIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByIsSecureIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByIsSecureIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     if (IsSecure) {
       stmtReadBuffByIsSecureIdx.setString(argIdx++, "Y");
     } else {
       stmtReadBuffByIsSecureIdx.setString(argIdx++, "N");
     }
     resultSet = stmtReadBuffByIsSecureIdx.executeQuery();
     List<CFInternetURLProtocolBuff> buffList = new LinkedList<CFInternetURLProtocolBuff>();
     while (resultSet.next()) {
       CFInternetURLProtocolBuff buff = unpackURLProtocolResultSetToBuff(resultSet);
       buffList.add(buff);
     }
     int idx = 0;
     CFInternetURLProtocolBuff[] retBuff = new CFInternetURLProtocolBuff[buffList.size()];
     Iterator<CFInternetURLProtocolBuff> 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 CFSecuritySecAppBuff readBuffByUJEEMountIdx(
     CFSecurityAuthorization Authorization, long ClusterId, String JEEMountName) {
   final String S_ProcName = "readBuffByUJEEMountIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql = "exec sp_read_secapp_by_ujeemountidx ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?";
     if (stmtReadBuffByUJEEMountIdx == null) {
       stmtReadBuffByUJEEMountIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByUJEEMountIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByUJEEMountIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByUJEEMountIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByUJEEMountIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByUJEEMountIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByUJEEMountIdx.setLong(argIdx++, ClusterId);
     stmtReadBuffByUJEEMountIdx.setString(argIdx++, JEEMountName);
     resultSet = stmtReadBuffByUJEEMountIdx.executeQuery();
     if (resultSet.next()) {
       CFSecuritySecAppBuff buff = unpackSecAppResultSetToBuff(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 CFSecurityISOCountryCurrencyBuff[] readBuffByCurrencyIdx(
     CFSecurityAuthorization Authorization, short ISOCurrencyId) {
   final String S_ProcName = "readBuffByCurrencyIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql =
         "{ call sp_read_iso_cntryccy_by_currencyidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) }";
     if (stmtReadBuffByCurrencyIdx == null) {
       stmtReadBuffByCurrencyIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByCurrencyIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByCurrencyIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByCurrencyIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByCurrencyIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByCurrencyIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByCurrencyIdx.setShort(argIdx++, ISOCurrencyId);
     resultSet = stmtReadBuffByCurrencyIdx.executeQuery();
     List<CFSecurityISOCountryCurrencyBuff> buffList =
         new LinkedList<CFSecurityISOCountryCurrencyBuff>();
     if (resultSet != null) {
       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 CFInternetURLProtocolBuff readBuffByIdIdx(
     CFSecurityAuthorization Authorization, short URLProtocolId) {
   final String S_ProcName = "readBuffByIdIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     final String sql = "CALL sp_read_urlproto_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.setShort(argIdx++, URLProtocolId);
     resultSet = stmtReadBuffByIdIdx.executeQuery();
     if (resultSet.next()) {
       CFInternetURLProtocolBuff buff = unpackURLProtocolResultSetToBuff(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 CFSecuritySecAppBuff[] 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();
     String sql = "exec sp_read_secapp_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<CFSecuritySecAppBuff> buffList = new LinkedList<CFSecuritySecAppBuff>();
     while (resultSet.next()) {
       CFSecuritySecAppBuff buff = unpackSecAppResultSetToBuff(resultSet);
       buffList.add(buff);
     }
     int idx = 0;
     CFSecuritySecAppBuff[] retBuff = new CFSecuritySecAppBuff[buffList.size()];
     Iterator<CFSecuritySecAppBuff> 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 deleteISOCountryCurrency(
      CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyBuff Buff) {
    final String S_ProcName = "deleteISOCountryCurrency";
    try {
      Connection cnx = schema.getCnx();
      short ISOCountryId = Buff.getRequiredISOCountryId();
      short ISOCurrencyId = Buff.getRequiredISOCurrencyId();

      String sql =
          "exec sp_delete_iso_cntryccy ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?";
      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++, ISOCountryId);
      stmtDeleteByPKey.setShort(argIdx++, ISOCurrencyId);
      stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision());
      ;
      Object stuff = null;
      boolean moreResults = stmtDeleteByPKey.execute();
      while (stuff == null) {
        try {
          moreResults = stmtDeleteByPKey.getMoreResults();
        } catch (SQLException e) {
          throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        if (moreResults) {
          try {
            stuff = stmtDeleteByPKey.getResultSet();
          } catch (SQLException e) {
          }
        } else if (-1 == stmtDeleteByPKey.getUpdateCount()) {
          break;
        }
      }
    } catch (SQLException e) {
      throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
  }
 public void updateISOCountryCurrency(
     CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyBuff Buff) {
   final String S_ProcName = "updateISOCountryCurrency";
   ResultSet resultSet = null;
   try {
     short ISOCountryId = Buff.getRequiredISOCountryId();
     short ISOCurrencyId = Buff.getRequiredISOCurrencyId();
     int Revision = Buff.getRequiredRevision();
     Connection cnx = schema.getCnx();
     String sql =
         "exec 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);
     stmtUpdateByPKey.execute();
     boolean moreResults = true;
     resultSet = null;
     while (resultSet == null) {
       try {
         moreResults = stmtUpdateByPKey.getMoreResults();
       } catch (SQLException e) {
         throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
       }
       if (moreResults) {
         try {
           resultSet = stmtUpdateByPKey.getResultSet();
         } catch (SQLException e) {
         }
       } else if (-1 == stmtUpdateByPKey.getUpdateCount()) {
         break;
       }
     }
     if (resultSet == null) {
       throw CFLib.getDefaultExceptionFactory()
           .newNullArgumentException(getClass(), S_ProcName, 0, "resultSet");
     }
     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;
     }
   }
 }
 /**
  * Release the prepared statements.
  *
  * <p>When the schema changes connections, the prepared statements have to be released because
  * they contain connection-specific information for most databases.
  */
 public void releasePreparedStatements() {
   final String S_ProcName = "releasePreparedStatements";
   S_sqlSelectISOCountryCurrencyDistinctClassCode = null;
   S_sqlSelectISOCountryCurrencyBuff = null;
   if (stmtReadBuffByPKey != null) {
     try {
       stmtReadBuffByPKey.close();
     } catch (SQLException e) {
     }
     stmtReadBuffByPKey = null;
   }
   if (stmtLockBuffByPKey != null) {
     try {
       stmtLockBuffByPKey.close();
     } catch (SQLException e) {
     }
     stmtLockBuffByPKey = null;
   }
   if (stmtCreateByPKey != null) {
     try {
       stmtCreateByPKey.close();
     } catch (SQLException e) {
     }
     stmtCreateByPKey = null;
   }
   if (stmtUpdateByPKey != null) {
     try {
       stmtUpdateByPKey.close();
     } catch (SQLException e) {
     }
     stmtUpdateByPKey = null;
   }
   if (stmtDeleteByPKey != null) {
     try {
       stmtDeleteByPKey.close();
     } catch (SQLException e) {
     }
     stmtDeleteByPKey = null;
   }
   if (stmtDeleteByCountryIdx != null) {
     try {
       stmtDeleteByCountryIdx.close();
     } catch (SQLException e) {
       //				throw CFLib.getDefaultExceptionFactory().newDbException( getClass(),
       //					S_ProcName,
       //					e );
     } finally {
       stmtDeleteByCountryIdx = null;
     }
   }
   if (stmtDeleteByCurrencyIdx != null) {
     try {
       stmtDeleteByCurrencyIdx.close();
     } catch (SQLException e) {
       //				throw CFLib.getDefaultExceptionFactory().newDbException( getClass(),
       //					S_ProcName,
       //					e );
     } finally {
       stmtDeleteByCurrencyIdx = null;
     }
   }
   if (stmtReadAllBuff != null) {
     try {
       stmtReadAllBuff.close();
     } catch (SQLException e) {
     }
     stmtReadAllBuff = null;
   }
   if (stmtReadBuffByIdIdx != null) {
     try {
       stmtReadBuffByIdIdx.close();
     } catch (SQLException e) {
     }
     stmtReadBuffByIdIdx = null;
   }
   if (stmtReadBuffByCountryIdx != null) {
     try {
       stmtReadBuffByCountryIdx.close();
     } catch (SQLException e) {
     }
     stmtReadBuffByCountryIdx = null;
   }
   if (stmtReadBuffByCurrencyIdx != null) {
     try {
       stmtReadBuffByCurrencyIdx.close();
     } catch (SQLException e) {
     }
     stmtReadBuffByCurrencyIdx = null;
   }
 }
 public void deleteSecAppByIdIdx(
     CFSecurityAuthorization Authorization, long ClusterId, int SecAppId) {
   final String S_ProcName = "deleteSecAppByIdIdx";
   try {
     Connection cnx = schema.getCnx();
     String sql = "exec sp_delete_secapp ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?";
     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++, SecAppId);
     Object stuff = null;
     boolean moreResults = stmtDeleteByPKey.execute();
     while (stuff == null) {
       try {
         moreResults = stmtDeleteByPKey.getMoreResults();
       } catch (SQLException e) {
         throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
       }
       if (moreResults) {
         try {
           stuff = stmtDeleteByPKey.getResultSet();
         } catch (SQLException e) {
         }
       } else if (-1 == stmtDeleteByPKey.getUpdateCount()) {
         break;
       }
     }
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   }
 }
 public void updateSecApp(CFSecurityAuthorization Authorization, CFSecuritySecAppBuff Buff) {
   final String S_ProcName = "updateSecApp";
   ResultSet resultSet = null;
   try {
     long ClusterId = Buff.getRequiredClusterId();
     int SecAppId = Buff.getRequiredSecAppId();
     String JEEMountName = Buff.getRequiredJEEMountName();
     int Revision = Buff.getRequiredRevision();
     Connection cnx = schema.getCnx();
     String sql =
         "exec sp_update_secapp ?, ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?";
     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++, "SAPP");
     stmtUpdateByPKey.setLong(argIdx++, ClusterId);
     stmtUpdateByPKey.setInt(argIdx++, SecAppId);
     stmtUpdateByPKey.setString(argIdx++, JEEMountName);
     stmtUpdateByPKey.setInt(argIdx++, Revision);
     resultSet = stmtUpdateByPKey.executeQuery();
     if (resultSet.next()) {
       CFSecuritySecAppBuff updatedBuff = unpackSecAppResultSetToBuff(resultSet);
       if (resultSet.next()) {
         resultSet.last();
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(),
                 S_ProcName,
                 "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
       }
       Buff.setRequiredJEEMountName(updatedBuff.getRequiredJEEMountName());
       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 createAccessFrequency(
     CFSecurityAuthorization Authorization, CFBamAccessFrequencyBuff Buff) {
   final String S_ProcName = "createAccessFrequency";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   try {
     short Id = Buff.getRequiredId();
     String Name = Buff.getRequiredName();
     Connection cnx = schema.getCnx();
     final String sql =
         "CALL sp_create_accfreq( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )";
     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++, "AFRQ");
     stmtCreateByPKey.setShort(argIdx++, Id);
     stmtCreateByPKey.setString(argIdx++, Name);
     resultSet = stmtCreateByPKey.executeQuery();
     if (resultSet.next()) {
       CFBamAccessFrequencyBuff createdBuff = unpackAccessFrequencyResultSetToBuff(resultSet);
       if (resultSet.next()) {
         resultSet.last();
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(),
                 S_ProcName,
                 "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
       }
       Buff.setRequiredId(createdBuff.getRequiredId());
       Buff.setRequiredName(createdBuff.getRequiredName());
       Buff.setRequiredRevision(createdBuff.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;
     }
   }
 }
  /**
   * Release the prepared statements.
   *
   * <p>When the schema changes connections, the prepared statements have to be released because
   * they contain connection-specific information for most databases.
   */
  public void releasePreparedStatements() {
    final String S_ProcName = "releasePreparedStatements";
    S_sqlSelectURLProtocolDistinctClassCode = null;
    S_sqlSelectURLProtocolBuff = null;

    if (stmtReadBuffByPKey != null) {
      try {
        stmtReadBuffByPKey.close();
      } catch (SQLException e) {
      }
      stmtReadBuffByPKey = null;
    }
    if (stmtReadAllBuff != null) {
      try {
        stmtReadAllBuff.close();
      } catch (SQLException e) {
      }
      stmtReadAllBuff = null;
    }
    if (stmtLockBuffByPKey != null) {
      try {
        stmtLockBuffByPKey.close();
      } catch (SQLException e) {
      }
      stmtLockBuffByPKey = null;
    }
    if (stmtCreateByPKey != null) {
      try {
        stmtCreateByPKey.close();
      } catch (SQLException e) {
      }
      stmtCreateByPKey = null;
    }
    if (stmtUpdateByPKey != null) {
      try {
        stmtUpdateByPKey.close();
      } catch (SQLException e) {
      }
      stmtUpdateByPKey = null;
    }
    if (stmtDeleteByPKey != null) {
      try {
        stmtDeleteByPKey.close();
      } catch (SQLException e) {
      }
      stmtDeleteByPKey = null;
    }
    if (stmtDeleteByIdIdx != null) {
      try {
        stmtDeleteByIdIdx.close();
      } catch (SQLException e) {
      }
      stmtDeleteByIdIdx = null;
    }
    if (stmtDeleteByUNameIdx != null) {
      try {
        stmtDeleteByUNameIdx.close();
      } catch (SQLException e) {
      }
      stmtDeleteByUNameIdx = null;
    }
    if (stmtDeleteByIsSecureIdx != null) {
      try {
        stmtDeleteByIsSecureIdx.close();
      } catch (SQLException e) {
      }
      stmtDeleteByIsSecureIdx = null;
    }
    if (stmtReadAllBuff != null) {
      try {
        stmtReadAllBuff.close();
      } catch (SQLException e) {
      }
      stmtReadAllBuff = null;
    }
    if (stmtReadBuffByIdIdx != null) {
      try {
        stmtReadBuffByIdIdx.close();
      } catch (SQLException e) {
      }
      stmtReadBuffByIdIdx = null;
    }
    if (stmtReadBuffByUNameIdx != null) {
      try {
        stmtReadBuffByUNameIdx.close();
      } catch (SQLException e) {
      }
      stmtReadBuffByUNameIdx = null;
    }
    if (stmtReadBuffByIsSecureIdx != null) {
      try {
        stmtReadBuffByIsSecureIdx.close();
      } catch (SQLException e) {
      }
      stmtReadBuffByIsSecureIdx = null;
    }
  }
 public void updateURLProtocol(
     CFSecurityAuthorization Authorization, CFInternetURLProtocolBuff Buff) {
   final String S_ProcName = "updateURLProtocol";
   if ("UPRT".equals(Buff.getClassCode()) && (!schema.isSystemUser(Authorization))) {
     throw CFLib.getDefaultExceptionFactory()
         .newRuntimeException(
             getClass(),
             S_ProcName,
             "Permission denied -- only system user can modify URLProtocol data");
   }
   ResultSet resultSet = null;
   try {
     short URLProtocolId = Buff.getRequiredURLProtocolId();
     String Name = Buff.getRequiredName();
     String Description = Buff.getRequiredDescription();
     boolean IsSecure = Buff.getRequiredIsSecure();
     int Revision = Buff.getRequiredRevision();
     Connection cnx = schema.getCnx();
     final String sql =
         "CALL sp_update_urlproto( ?, ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + " )";
     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++, "UPRT");
     stmtUpdateByPKey.setShort(argIdx++, URLProtocolId);
     stmtUpdateByPKey.setString(argIdx++, Name);
     stmtUpdateByPKey.setString(argIdx++, Description);
     if (IsSecure) {
       stmtUpdateByPKey.setString(argIdx++, "Y");
     } else {
       stmtUpdateByPKey.setString(argIdx++, "N");
     }
     stmtUpdateByPKey.setInt(argIdx++, Revision);
     resultSet = stmtUpdateByPKey.executeQuery();
     if (resultSet.next()) {
       CFInternetURLProtocolBuff updatedBuff = unpackURLProtocolResultSetToBuff(resultSet);
       if (resultSet.next()) {
         resultSet.last();
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(),
                 S_ProcName,
                 "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
       }
       Buff.setRequiredName(updatedBuff.getRequiredName());
       Buff.setRequiredDescription(updatedBuff.getRequiredDescription());
       Buff.setRequiredIsSecure(updatedBuff.getRequiredIsSecure());
       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;
     }
   }
 }