public void deleteAuditActionByUDescrIdx(
     CFSecurityAuthorization Authorization, String argDescription) {
   final String S_ProcName = "deleteAuditActionByUDescrIdx";
   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_auditaction_by_udescridx ?, ?, ?, ?, ?" + ", " + "?";
     if (stmtDeleteByUDescrIdx == null) {
       stmtDeleteByUDescrIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtDeleteByUDescrIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByUDescrIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtDeleteByUDescrIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtDeleteByUDescrIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByUDescrIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtDeleteByUDescrIdx.setString(argIdx++, argDescription);
     Object stuff = null;
     boolean moreResults = stmtDeleteByUDescrIdx.execute();
     while (stuff == null) {
       try {
         moreResults = stmtDeleteByUDescrIdx.getMoreResults();
       } catch (SQLException e) {
         throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
       }
       if (moreResults) {
         try {
           stuff = stmtDeleteByUDescrIdx.getResultSet();
         } catch (SQLException e) {
         }
       } else if (-1 == stmtDeleteByUDescrIdx.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 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();
     String sql = "exec 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 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();

      String sql =
          "call "
              + schema.getLowerDbSchemaName()
              + ".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());
      ;
      stmtDeleteByPKey.executeUpdate();
    } 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[] readBuffByClusterIdx(
     CFSecurityAuthorization Authorization, long ClusterId) {
   final String S_ProcName = "readBuffByClusterIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql =
         "call "
             + schema.getLowerDbSchemaName()
             + ".sp_read_secform_by_clusteridx( ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + " )";
     if (stmtReadBuffByClusterIdx == null) {
       stmtReadBuffByClusterIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByClusterIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByClusterIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByClusterIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByClusterIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByClusterIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByClusterIdx.setLong(argIdx++, ClusterId);
     try {
       resultSet = stmtReadBuffByClusterIdx.executeQuery();
     } catch (SQLException e) {
       if (e.getErrorCode() != 1329) {
         throw e;
       }
       resultSet = null;
     }
     List<CFSecuritySecFormBuff> buffList = new LinkedList<CFSecuritySecFormBuff>();
     while ((resultSet != null) && 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 void deleteSecFormByUJEEServletIdx(
     CFSecurityAuthorization Authorization,
     long argClusterId,
     int argSecAppId,
     String argJEEServletMapName) {
   final String S_ProcName = "deleteSecFormByUJEEServletIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql =
         "call "
             + schema.getLowerDbSchemaName()
             + ".sp_delete_secform_by_ujeeservletidx( ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + " )";
     if (stmtDeleteByUJEEServletIdx == null) {
       stmtDeleteByUJEEServletIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtDeleteByUJEEServletIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByUJEEServletIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtDeleteByUJEEServletIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtDeleteByUJEEServletIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByUJEEServletIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtDeleteByUJEEServletIdx.setLong(argIdx++, argClusterId);
     stmtDeleteByUJEEServletIdx.setInt(argIdx++, argSecAppId);
     stmtDeleteByUJEEServletIdx.setString(argIdx++, argJEEServletMapName);
     stmtDeleteByUJEEServletIdx.executeUpdate();
   } 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 readBuffByIdIdx(
     CFSecurityAuthorization Authorization, long ClusterId, int SecFormId) {
   final String S_ProcName = "readBuffByIdIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql = "exec 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 CFSecurityAuditActionBuff[] 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 = "{ call sp_read_auditaction_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<CFSecurityAuditActionBuff> buffList = new LinkedList<CFSecurityAuditActionBuff>();
     if (resultSet != null) {
       while (resultSet.next()) {
         CFSecurityAuditActionBuff buff = unpackAuditActionResultSetToBuff(resultSet);
         buffList.add(buff);
       }
     }
     int idx = 0;
     CFSecurityAuditActionBuff[] retBuff = new CFSecurityAuditActionBuff[buffList.size()];
     Iterator<CFSecurityAuditActionBuff> 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;
     }
   }
 }
 /**
  * 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_sqlSelectAuditActionDistinctClassCode = null;
   S_sqlSelectAuditActionBuff = 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 (stmtDeleteByUDescrIdx != null) {
     try {
       stmtDeleteByUDescrIdx.close();
     } catch (SQLException e) {
       //				throw CFLib.getDefaultExceptionFactory().newDbException( getClass(),
       //					S_ProcName,
       //					e );
     } finally {
       stmtDeleteByUDescrIdx = null;
     }
   }
   if (stmtReadAllBuff != null) {
     try {
       stmtReadAllBuff.close();
     } catch (SQLException e) {
     }
     stmtReadAllBuff = null;
   }
   if (stmtReadBuffByIdIdx != null) {
     try {
       stmtReadBuffByIdIdx.close();
     } catch (SQLException e) {
     }
     stmtReadBuffByIdIdx = null;
   }
   if (stmtReadBuffByUDescrIdx != null) {
     try {
       stmtReadBuffByUDescrIdx.close();
     } catch (SQLException e) {
     }
     stmtReadBuffByUDescrIdx = null;
   }
 }
  public void deleteAuditAction(
      CFSecurityAuthorization Authorization, CFSecurityAuditActionBuff Buff) {
    final String S_ProcName = "deleteAuditAction";
    try {
      Connection cnx = schema.getCnx();
      short AuditActionId = Buff.getRequiredAuditActionId();

      String sql = "exec sp_delete_auditaction ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?";
      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++, AuditActionId);
      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 createAuditAction(
     CFSecurityAuthorization Authorization, CFSecurityAuditActionBuff Buff) {
   final String S_ProcName = "createAuditAction";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   try {
     short AuditActionId = Buff.getRequiredAuditActionId();
     String Description = Buff.getRequiredDescription();
     Connection cnx = schema.getCnx();
     String sql = "exec sp_create_auditaction ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?";
     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++, "AUDT");
     stmtCreateByPKey.setShort(argIdx++, AuditActionId);
     stmtCreateByPKey.setString(argIdx++, Description);
     stmtCreateByPKey.execute();
     boolean moreResults = true;
     resultSet = null;
     while (resultSet == null) {
       try {
         moreResults = stmtCreateByPKey.getMoreResults();
       } catch (SQLException e) {
         throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
       }
       if (moreResults) {
         try {
           resultSet = stmtCreateByPKey.getResultSet();
         } catch (SQLException e) {
         }
       } else if (-1 == stmtCreateByPKey.getUpdateCount()) {
         break;
       }
     }
     if (resultSet == null) {
       throw CFLib.getDefaultExceptionFactory()
           .newNullArgumentException(getClass(), S_ProcName, 0, "resultSet");
     }
     if (resultSet.next()) {
       CFSecurityAuditActionBuff createdBuff = unpackAuditActionResultSetToBuff(resultSet);
       if (resultSet.next()) {
         resultSet.last();
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(),
                 S_ProcName,
                 "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
       }
       Buff.setRequiredAuditActionId(createdBuff.getRequiredAuditActionId());
       Buff.setRequiredDescription(createdBuff.getRequiredDescription());
       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;
     }
   }
 }
 public CFSecurityAuditActionBuff lockBuff(
     CFSecurityAuthorization Authorization, CFSecurityAuditActionPKey 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 AuditActionId = PKey.getRequiredAuditActionId();
     String sql = "{ call sp_lock_auditaction( ?, ?, ?, ?, ?" + ", " + "?" + " ) }";
     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++, AuditActionId);
     stmtLockBuffByPKey.execute();
     boolean moreResults = true;
     resultSet = null;
     while (resultSet == null) {
       try {
         moreResults = stmtLockBuffByPKey.getMoreResults();
       } catch (SQLException e) {
         throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
       }
       if (moreResults) {
         try {
           resultSet = stmtLockBuffByPKey.getResultSet();
         } catch (SQLException e) {
         }
       } else if (-1 == stmtLockBuffByPKey.getUpdateCount()) {
         break;
       }
     }
     if ((resultSet != null) && resultSet.next()) {
       CFSecurityAuditActionBuff buff = unpackAuditActionResultSetToBuff(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 void updateSecForm(CFSecurityAuthorization Authorization, CFSecuritySecFormBuff Buff) {
   final String S_ProcName = "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();
     String sql =
         "exec 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;
     }
   }
 }
 /**
  * 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() {
   S_sqlSelectSecFormDistinctClassCode = null;
   S_sqlSelectSecFormBuff = 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 (stmtDeleteByIdIdx != null) {
     try {
       stmtDeleteByIdIdx.close();
     } catch (SQLException e) {
     }
     stmtDeleteByIdIdx = null;
   }
   if (stmtDeleteByClusterIdx != null) {
     try {
       stmtDeleteByClusterIdx.close();
     } catch (SQLException e) {
     }
     stmtDeleteByClusterIdx = null;
   }
   if (stmtDeleteBySecAppIdx != null) {
     try {
       stmtDeleteBySecAppIdx.close();
     } catch (SQLException e) {
     }
     stmtDeleteBySecAppIdx = null;
   }
   if (stmtDeleteByUJEEServletIdx != null) {
     try {
       stmtDeleteByUJEEServletIdx.close();
     } catch (SQLException e) {
     }
     stmtDeleteByUJEEServletIdx = null;
   }
   if (stmtReadAllBuff != null) {
     try {
       stmtReadAllBuff.close();
     } catch (SQLException e) {
     }
     stmtReadAllBuff = null;
   }
   if (stmtReadBuffByIdIdx != null) {
     try {
       stmtReadBuffByIdIdx.close();
     } catch (SQLException e) {
     }
     stmtReadBuffByIdIdx = null;
   }
   if (stmtReadBuffByClusterIdx != null) {
     try {
       stmtReadBuffByClusterIdx.close();
     } catch (SQLException e) {
     }
     stmtReadBuffByClusterIdx = null;
   }
   if (stmtReadBuffBySecAppIdx != null) {
     try {
       stmtReadBuffBySecAppIdx.close();
     } catch (SQLException e) {
     }
     stmtReadBuffBySecAppIdx = null;
   }
   if (stmtReadBuffByUJEEServletIdx != null) {
     try {
       stmtReadBuffByUJEEServletIdx.close();
     } catch (SQLException e) {
     }
     stmtReadBuffByUJEEServletIdx = null;
   }
 }