Example usage for java.sql CallableStatement setShort

List of usage examples for java.sql CallableStatement setShort

Introduction

In this page you can find the example usage for java.sql CallableStatement setShort.

Prototype

void setShort(String parameterName, short x) throws SQLException;

Source Link

Document

Sets the designated parameter to the given Java short value.

Usage

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleAddressTable.java

public void updateAddress(CFAccAuthorization Authorization, CFAccAddressBuff Buff) {
    final String S_ProcName = "updateAddress";
    ResultSet resultSet = null;//from   w ww.  j av a 2s .co  m
    Connection cnx = schema.getCnx();
    CallableStatement stmtUpdateByPKey = null;
    List<CFAccAddressBuff> buffList = new LinkedList<CFAccAddressBuff>();
    try {
        long TenantId = Buff.getRequiredTenantId();
        long AddressId = Buff.getRequiredAddressId();
        long ContactId = Buff.getRequiredContactId();
        String Description = Buff.getRequiredDescription();
        String AddrLine1 = Buff.getOptionalAddrLine1();
        String AddrLine2 = Buff.getOptionalAddrLine2();
        String City = Buff.getOptionalCity();
        String State = Buff.getOptionalState();
        Short CountryId = Buff.getOptionalCountryId();
        String Zip = Buff.getOptionalZip();
        int Revision = Buff.getRequiredRevision();
        stmtUpdateByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".upd_address( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", "
                + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); end;");
        int argIdx = 1;
        stmtUpdateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        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++, "ADR");
        stmtUpdateByPKey.setLong(argIdx++, TenantId);
        stmtUpdateByPKey.setLong(argIdx++, AddressId);
        stmtUpdateByPKey.setLong(argIdx++, ContactId);
        stmtUpdateByPKey.setString(argIdx++, Description);
        if (AddrLine1 != null) {
            stmtUpdateByPKey.setString(argIdx++, AddrLine1);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (AddrLine2 != null) {
            stmtUpdateByPKey.setString(argIdx++, AddrLine2);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (City != null) {
            stmtUpdateByPKey.setString(argIdx++, City);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (State != null) {
            stmtUpdateByPKey.setString(argIdx++, State);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (CountryId != null) {
            stmtUpdateByPKey.setShort(argIdx++, CountryId.shortValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        if (Zip != null) {
            stmtUpdateByPKey.setString(argIdx++, Zip);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        stmtUpdateByPKey.setInt(argIdx++, Revision);
        stmtUpdateByPKey.execute();
        resultSet = (ResultSet) stmtUpdateByPKey.getObject(1);
        if (resultSet != null) {
            try {
                if (resultSet.next()) {
                    CFAccAddressBuff updatedBuff = unpackAddressResultSetToBuff(resultSet);
                    if (resultSet.next()) {
                        resultSet.last();
                        throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                                "Did not expect multi-record response, " + resultSet.getRow()
                                        + " rows selected");
                    }
                    Buff.setRequiredContactId(updatedBuff.getRequiredContactId());
                    Buff.setRequiredDescription(updatedBuff.getRequiredDescription());
                    Buff.setOptionalAddrLine1(updatedBuff.getOptionalAddrLine1());
                    Buff.setOptionalAddrLine2(updatedBuff.getOptionalAddrLine2());
                    Buff.setOptionalCity(updatedBuff.getOptionalCity());
                    Buff.setOptionalState(updatedBuff.getOptionalState());
                    Buff.setOptionalCountryId(updatedBuff.getOptionalCountryId());
                    Buff.setOptionalZip(updatedBuff.getOptionalZip());
                    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().newRuntimeException(getClass(), S_ProcName,
                        "upd_address() did not return a valid result cursor");
            } finally {
                if (resultSet != null) {
                    try {
                        resultSet.close();
                    } catch (SQLException e) {
                    }
                    resultSet = null;
                }
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "upd_address() did not return a result cursor");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
        if (stmtUpdateByPKey != null) {
            try {
                stmtUpdateByPKey.close();
            } catch (SQLException e) {
            }
            stmtUpdateByPKey = null;
        }
    }
}

From source file:com.mimp.hibernate.HiberEtapa.java

public void UpdateFamilia(Familia temp) {

    Session session = sessionFactory.getCurrentSession();
    session.beginTransaction();//from  w  ww  . j a va  2  s.c o  m

    final Long idFam = temp.getIdfamilia();
    final String user = temp.getUser();
    final String pas = temp.getPass();
    final short hab = temp.getHabilitado();
    final String mail = temp.getCorreo();
    final String cons = temp.getConstancia();

    Work work = new Work() {
        @Override
        public void execute(Connection connection) throws SQLException {

            String hql = "{call HE_UPDATE_FAMILIA(?,?,?,?,?,?)}";
            CallableStatement statement = connection.prepareCall(hql);
            statement.setLong(1, idFam);
            statement.setString(2, user);
            statement.setString(3, pas);
            statement.setString(4, mail);
            statement.setShort(5, hab);
            statement.setString(6, cons);

            statement.execute();
            statement.close();
        }
    };

    session.doWork(work);

}

From source file:com.mimp.hibernate.HiberEtapa.java

public void updateDesignacion(Designacion temp) {

    Session session = sessionFactory.getCurrentSession();
    session.beginTransaction();/*w w  w  . j a v  a 2  s.co m*/

    final Long idDe = temp.getIddesignacion();
    final Long idEx = temp.getExpedienteFamilia().getIdexpedienteFamilia();
    final Long idNna = temp.getNna().getIdnna();
    final Long idPer = temp.getPersonal().getIdpersonal();
    final String nDesig = temp.getNDesignacion();
    final Long prio = temp.getPrioridad();
    final Date fechaPro = temp.getFechaPropuesta();
    final Date fechaCon = temp.getFechaConsejo();
    final short acepCon = temp.getAceptacionConsejo();
    final String tipo = temp.getTipoPropuesta();
    final String obs = temp.getObs();

    Work work = new Work() {
        @Override
        public void execute(Connection connection) throws SQLException {

            String hql = "{call HE_UPDATE_DESIG(?,?,?,?,?,?,?,?)}";
            CallableStatement statement = connection.prepareCall(hql);
            statement.setLong(1, idDe);
            statement.setString(2, nDesig);
            statement.setLong(3, prio);
            statement.setDate(4, (java.sql.Date) fechaPro);
            statement.setDate(5, (java.sql.Date) fechaCon);
            statement.setShort(6, acepCon);
            statement.setString(7, tipo);
            statement.setString(8, obs);
            statement.execute();
            statement.close();
        }
    };

    session.doWork(work);

}

From source file:com.mimp.hibernate.HiberEtapa.java

public void updateExpedienteFamilia(ExpedienteFamilia temp) {

    Session session = sessionFactory.getCurrentSession();
    session.beginTransaction();//from  w ww.j  av a2 s. c om

    final String expediente = temp.getExpediente();
    final String ht = temp.getHt();
    final String numExp = temp.getNumeroExpediente();
    final String estado = temp.getEstado();
    final String nac = temp.getNacionalidad();
    final short rnsa = temp.getRnsa();
    final short rnaa = temp.getRnaa();
    final String tipofam = temp.getTipoFamilia();
    final String tipolista = temp.getTipoListaEspera();
    final String htficha = temp.getHtFicha();
    final String nficha = temp.getnFicha();
    final Long idExp = temp.getIdexpedienteFamilia();

    Work work = new Work() {
        @Override
        public void execute(Connection connection) throws SQLException {

            String hql = "{call HE_UPDATEEXP(?,?,?,?,?,?,?,?,?,?,?,?)}";
            CallableStatement statement = connection.prepareCall(hql);
            statement.setLong(1, idExp);
            statement.setString(2, expediente);
            statement.setString(3, ht);
            statement.setString(4, numExp);
            statement.setString(5, estado);
            statement.setString(6, nac);
            statement.setShort(7, rnsa);
            statement.setShort(8, rnaa);
            statement.setString(9, tipofam);
            statement.setString(10, tipolista);
            statement.setString(11, htficha);
            statement.setString(12, nficha);

            statement.execute();
            statement.close();
        }
    };

    session.doWork(work);

}

From source file:com.mimp.hibernate.HiberEtapa.java

public void crearDesignacion(Designacion temp) {

    Session session = sessionFactory.getCurrentSession();
    session.beginTransaction();//from  w ww  .  j a  va2s. c om

    final Long idEx = temp.getExpedienteFamilia().getIdexpedienteFamilia();
    final Long idNna = temp.getNna().getIdnna();
    final Long idPer = temp.getPersonal().getIdpersonal();
    final String nDesig = temp.getNDesignacion();
    final Date fechaPro = temp.getFechaPropuesta();
    final Date fechaCon = temp.getFechaConsejo();
    final short acepCon = temp.getAceptacionConsejo();
    final String tipo = temp.getTipoPropuesta();
    final String obs = temp.getObs();

    Work work = new Work() {
        @Override
        public void execute(Connection connection) throws SQLException {

            String hql = "{call HE_CREAR_DESIG(?,?,?,?,?,?,?,?,?)}";
            CallableStatement statement = connection.prepareCall(hql);
            statement.setLong(1, idEx);
            statement.setLong(2, idNna);
            statement.setLong(3, idPer);
            statement.setString(4, nDesig);
            statement.setDate(5, (java.sql.Date) fechaPro);
            statement.setDate(6, (java.sql.Date) fechaCon);
            statement.setShort(7, acepCon);
            statement.setString(8, tipo);
            statement.setString(9, obs);
            statement.execute();
            statement.close();
        }
    };

    session.doWork(work);

}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleAccountEntryTable.java

public void createAccountEntry(CFAccAuthorization Authorization, CFAccAccountEntryBuff Buff) {
    final String S_ProcName = "createAccountEntry";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*from   w w w .  j a  va 2 s.com*/
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        long TenantId = Buff.getRequiredTenantId();
        long AccountId = Buff.getRequiredAccountId();
        UUID SplitEntryId = Buff.getOptionalSplitEntryId();
        Calendar EntryStamp = Buff.getRequiredEntryStamp();
        String Description = Buff.getRequiredDescription();
        Long TransferTenantId = Buff.getOptionalTransferTenantId();
        Long TransferAccountId = Buff.getOptionalTransferAccountId();
        Short DebitCurrencyId = Buff.getOptionalDebitCurrencyId();
        BigDecimal Debit = Buff.getOptionalDebit();
        Short CreditCurrencyId = Buff.getOptionalCreditCurrencyId();
        BigDecimal Credit = Buff.getOptionalCredit();
        short ConvertedCurrencyId = Buff.getRequiredConvertedCurrencyId();
        BigDecimal ConvertedAmount = Buff.getRequiredConvertedAmount();
        short BalanceCurrencyId = Buff.getRequiredBalanceCurrencyId();
        BigDecimal Balance = Buff.getRequiredBalance();

        UUID EntryId = UUID.randomUUID();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".crt_ac_entry( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "to_timestamp( ?, 'YYYY-MM-DD HH24:MI:SS' )" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        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++, "ACNY");
        stmtCreateByPKey.setLong(argIdx++, TenantId);
        stmtCreateByPKey.setLong(argIdx++, AccountId);
        stmtCreateByPKey.setString(argIdx++, EntryId.toString());
        if (SplitEntryId != null) {
            stmtCreateByPKey.setString(argIdx++, SplitEntryId.toString());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        stmtCreateByPKey.setString(argIdx++, CFAccOracleSchema.getTimestampString(EntryStamp));
        stmtCreateByPKey.setString(argIdx++, Description);
        if (TransferTenantId != null) {
            stmtCreateByPKey.setLong(argIdx++, TransferTenantId.longValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (TransferAccountId != null) {
            stmtCreateByPKey.setLong(argIdx++, TransferAccountId.longValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (DebitCurrencyId != null) {
            stmtCreateByPKey.setShort(argIdx++, DebitCurrencyId.shortValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        if (Debit != null) {
            stmtCreateByPKey.setBigDecimal(argIdx++, Debit);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.NUMERIC);
        }
        if (CreditCurrencyId != null) {
            stmtCreateByPKey.setShort(argIdx++, CreditCurrencyId.shortValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        if (Credit != null) {
            stmtCreateByPKey.setBigDecimal(argIdx++, Credit);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.NUMERIC);
        }
        stmtCreateByPKey.setShort(argIdx++, ConvertedCurrencyId);
        stmtCreateByPKey.setBigDecimal(argIdx++, ConvertedAmount);
        stmtCreateByPKey.setShort(argIdx++, BalanceCurrencyId);
        stmtCreateByPKey.setBigDecimal(argIdx++, Balance);
        stmtCreateByPKey.execute();
        resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
        if (resultSet == null) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_ac_entry() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFAccAccountEntryBuff createdBuff = unpackAccountEntryResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                Buff.setRequiredTenantId(createdBuff.getRequiredTenantId());
                Buff.setRequiredAccountId(createdBuff.getRequiredAccountId());
                Buff.setRequiredEntryId(createdBuff.getRequiredEntryId());
                Buff.setOptionalSplitEntryId(createdBuff.getOptionalSplitEntryId());
                Buff.setRequiredEntryStamp(createdBuff.getRequiredEntryStamp());
                Buff.setRequiredDescription(createdBuff.getRequiredDescription());
                Buff.setOptionalTransferTenantId(createdBuff.getOptionalTransferTenantId());
                Buff.setOptionalTransferAccountId(createdBuff.getOptionalTransferAccountId());
                Buff.setOptionalDebitCurrencyId(createdBuff.getOptionalDebitCurrencyId());
                Buff.setOptionalDebit(createdBuff.getOptionalDebit());
                Buff.setOptionalCreditCurrencyId(createdBuff.getOptionalCreditCurrencyId());
                Buff.setOptionalCredit(createdBuff.getOptionalCredit());
                Buff.setRequiredConvertedCurrencyId(createdBuff.getRequiredConvertedCurrencyId());
                Buff.setRequiredConvertedAmount(createdBuff.getRequiredConvertedAmount());
                Buff.setRequiredBalanceCurrencyId(createdBuff.getRequiredBalanceCurrencyId());
                Buff.setRequiredBalance(createdBuff.getRequiredBalance());
                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().newRuntimeException(getClass(), S_ProcName,
                    "crt_ac_entry() did not return a valid result set");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
        if (stmtCreateByPKey != null) {
            try {
                stmtCreateByPKey.close();
            } catch (SQLException e) {
            }
            stmtCreateByPKey = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleAccountEntryTable.java

public void updateAccountEntry(CFAccAuthorization Authorization, CFAccAccountEntryBuff Buff) {
    final String S_ProcName = "updateAccountEntry";
    ResultSet resultSet = null;//w  w w .j ava2 s .co  m
    Connection cnx = schema.getCnx();
    CallableStatement stmtUpdateByPKey = null;
    List<CFAccAccountEntryBuff> buffList = new LinkedList<CFAccAccountEntryBuff>();
    try {
        long TenantId = Buff.getRequiredTenantId();
        long AccountId = Buff.getRequiredAccountId();
        UUID EntryId = Buff.getRequiredEntryId();
        UUID SplitEntryId = Buff.getOptionalSplitEntryId();
        Calendar EntryStamp = Buff.getRequiredEntryStamp();
        String Description = Buff.getRequiredDescription();
        Long TransferTenantId = Buff.getOptionalTransferTenantId();
        Long TransferAccountId = Buff.getOptionalTransferAccountId();
        Short DebitCurrencyId = Buff.getOptionalDebitCurrencyId();
        BigDecimal Debit = Buff.getOptionalDebit();
        Short CreditCurrencyId = Buff.getOptionalCreditCurrencyId();
        BigDecimal Credit = Buff.getOptionalCredit();
        short ConvertedCurrencyId = Buff.getRequiredConvertedCurrencyId();
        BigDecimal ConvertedAmount = Buff.getRequiredConvertedAmount();
        short BalanceCurrencyId = Buff.getRequiredBalanceCurrencyId();
        BigDecimal Balance = Buff.getRequiredBalance();
        int Revision = Buff.getRequiredRevision();
        stmtUpdateByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".upd_ac_entry( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "to_timestamp( ?, 'YYYY-MM-DD HH24:MI:SS' )" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "? ); end;");
        int argIdx = 1;
        stmtUpdateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        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++, "ACNY");
        stmtUpdateByPKey.setLong(argIdx++, TenantId);
        stmtUpdateByPKey.setLong(argIdx++, AccountId);
        stmtUpdateByPKey.setString(argIdx++, EntryId.toString());
        if (SplitEntryId != null) {
            stmtUpdateByPKey.setString(argIdx++, SplitEntryId.toString());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        stmtUpdateByPKey.setString(argIdx++, CFAccOracleSchema.getTimestampString(EntryStamp));
        stmtUpdateByPKey.setString(argIdx++, Description);
        if (TransferTenantId != null) {
            stmtUpdateByPKey.setLong(argIdx++, TransferTenantId.longValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (TransferAccountId != null) {
            stmtUpdateByPKey.setLong(argIdx++, TransferAccountId.longValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (DebitCurrencyId != null) {
            stmtUpdateByPKey.setShort(argIdx++, DebitCurrencyId.shortValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        if (Debit != null) {
            stmtUpdateByPKey.setBigDecimal(argIdx++, Debit);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.NUMERIC);
        }
        if (CreditCurrencyId != null) {
            stmtUpdateByPKey.setShort(argIdx++, CreditCurrencyId.shortValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        if (Credit != null) {
            stmtUpdateByPKey.setBigDecimal(argIdx++, Credit);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.NUMERIC);
        }
        stmtUpdateByPKey.setShort(argIdx++, ConvertedCurrencyId);
        stmtUpdateByPKey.setBigDecimal(argIdx++, ConvertedAmount);
        stmtUpdateByPKey.setShort(argIdx++, BalanceCurrencyId);
        stmtUpdateByPKey.setBigDecimal(argIdx++, Balance);
        stmtUpdateByPKey.setInt(argIdx++, Revision);
        stmtUpdateByPKey.execute();
        resultSet = (ResultSet) stmtUpdateByPKey.getObject(1);
        if (resultSet != null) {
            try {
                if (resultSet.next()) {
                    CFAccAccountEntryBuff updatedBuff = unpackAccountEntryResultSetToBuff(resultSet);
                    if (resultSet.next()) {
                        resultSet.last();
                        throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                                "Did not expect multi-record response, " + resultSet.getRow()
                                        + " rows selected");
                    }
                    Buff.setOptionalSplitEntryId(updatedBuff.getOptionalSplitEntryId());
                    Buff.setRequiredEntryStamp(updatedBuff.getRequiredEntryStamp());
                    Buff.setRequiredDescription(updatedBuff.getRequiredDescription());
                    Buff.setOptionalTransferTenantId(updatedBuff.getOptionalTransferTenantId());
                    Buff.setOptionalTransferAccountId(updatedBuff.getOptionalTransferAccountId());
                    Buff.setOptionalDebitCurrencyId(updatedBuff.getOptionalDebitCurrencyId());
                    Buff.setOptionalDebit(updatedBuff.getOptionalDebit());
                    Buff.setOptionalCreditCurrencyId(updatedBuff.getOptionalCreditCurrencyId());
                    Buff.setOptionalCredit(updatedBuff.getOptionalCredit());
                    Buff.setRequiredConvertedCurrencyId(updatedBuff.getRequiredConvertedCurrencyId());
                    Buff.setRequiredConvertedAmount(updatedBuff.getRequiredConvertedAmount());
                    Buff.setRequiredBalanceCurrencyId(updatedBuff.getRequiredBalanceCurrencyId());
                    Buff.setRequiredBalance(updatedBuff.getRequiredBalance());
                    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().newRuntimeException(getClass(), S_ProcName,
                        "upd_ac_entry() did not return a valid result cursor");
            } finally {
                if (resultSet != null) {
                    try {
                        resultSet.close();
                    } catch (SQLException e) {
                    }
                    resultSet = null;
                }
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "upd_ac_entry() did not return a result cursor");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
        if (stmtUpdateByPKey != null) {
            try {
                stmtUpdateByPKey.close();
            } catch (SQLException e) {
            }
            stmtUpdateByPKey = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswOracle.CFFswOracleFSSFVMailTable.java

public void createFSSFVMail(CFFswAuthorization Authorization, CFFswFSSFVMailBuff Buff) {
    final String S_ProcName = "createFSSFVMail";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*from   w ww  .ja va  2s  .com*/
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        long TenantId = Buff.getRequiredTenantId();
        long FSSFVMailId = Buff.getRequiredFSSFVMailId();
        long FSSofiaId = Buff.getRequiredFSSofiaId();
        String Name = Buff.getRequiredName();
        String TemplateFile = Buff.getRequiredTemplateFile();
        String NotifyTemplateFile = Buff.getRequiredNotifyTemplateFile();
        String DateFmt = Buff.getRequiredDateFmt();
        String EmailFrom = Buff.getRequiredEmailFrom();
        String FileExtension = Buff.getRequiredFileExtension();
        String TerminatorKey = Buff.getRequiredTerminatorKey();
        short MaxLoginAttempts = Buff.getRequiredMaxLoginAttempts();
        int DigitTimeout = Buff.getRequiredDigitTimeout();
        int MinRecordLen = Buff.getRequiredMinRecordLen();
        int MaxRecordLen = Buff.getRequiredMaxRecordLen();
        short MaxRetries = Buff.getRequiredMaxRetries();
        String ToneSpec = Buff.getRequiredToneSpec();
        String CallbackDialplan = Buff.getRequiredCallbackDialplan();
        String CallbackContext = Buff.getOptionalCallbackContext();
        String PlayNewMessagesKey = Buff.getRequiredPlayNewMessagesKey();
        String PlaySavedMessagesKey = Buff.getRequiredPlaySavedMessagesKey();
        String LoginKeys = Buff.getRequiredLoginKeys();
        String MainMenuKey = Buff.getRequiredMainMenuKey();
        String ConfigMenuKey = Buff.getRequiredConfigMenuKey();
        String RecordGreetingKey = Buff.getRequiredRecordGreetingKey();
        String ChooseGreetingKey = Buff.getRequiredChooseGreetingKey();
        String ChangePassKey = Buff.getRequiredChangePassKey();
        String RecordNameKey = Buff.getRequiredRecordNameKey();
        String RecordFileKey = Buff.getRequiredRecordFileKey();
        String ListenFileKey = Buff.getRequiredListenFileKey();
        String SaveFileKey = Buff.getRequiredSaveFileKey();
        String DeleteFileKey = Buff.getRequiredDeleteFileKey();
        String UndeleteFileKey = Buff.getRequiredUndeleteFileKey();
        String EMailKey = Buff.getRequiredEMailKey();
        String PauseKey = Buff.getRequiredPauseKey();
        String RestartKey = Buff.getRequiredRestartKey();
        String FastForwardKey = Buff.getRequiredFastForwardKey();
        String RewindKey = Buff.getRequiredRewindKey();
        String SkipGreetKey = Buff.getRequiredSkipGreetKey();
        int RecordSilenceThreshold = Buff.getRequiredRecordSilenceThreshold();
        short RecordSilenceHits = Buff.getRequiredRecordSilenceHits();
        String WebTemplateFile = Buff.getRequiredWebTemplateFile();
        int RecordSampleRate = Buff.getRequiredRecordSampleRate();
        String OperatorExtension = Buff.getRequiredOperatorExtension();
        String VMainExtension = Buff.getRequiredVMainExtension();
        String VMailKey = Buff.getRequiredVMailKey();
        boolean AutoPlaybackRecordings = Buff.getRequiredAutoPlaybackRecordings();
        String StorageDir = Buff.getRequiredStorageDir();
        String OdbcDSN = Buff.getOptionalOdbcDSN();
        String RecordComent = Buff.getOptionalRecordComent();
        String RecordTitle = Buff.getOptionalRecordTitle();
        String RecordCopyright = Buff.getOptionalRecordCopyright();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".crt_fssfvm( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", "
                + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        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++, "FSVM");
        stmtCreateByPKey.setLong(argIdx++, TenantId);
        stmtCreateByPKey.setLong(argIdx++, FSSFVMailId);
        stmtCreateByPKey.setLong(argIdx++, FSSofiaId);
        stmtCreateByPKey.setString(argIdx++, Name);
        stmtCreateByPKey.setString(argIdx++, TemplateFile);
        stmtCreateByPKey.setString(argIdx++, NotifyTemplateFile);
        stmtCreateByPKey.setString(argIdx++, DateFmt);
        stmtCreateByPKey.setString(argIdx++, EmailFrom);
        stmtCreateByPKey.setString(argIdx++, FileExtension);
        stmtCreateByPKey.setString(argIdx++, TerminatorKey);
        stmtCreateByPKey.setShort(argIdx++, MaxLoginAttempts);
        stmtCreateByPKey.setInt(argIdx++, DigitTimeout);
        stmtCreateByPKey.setInt(argIdx++, MinRecordLen);
        stmtCreateByPKey.setInt(argIdx++, MaxRecordLen);
        stmtCreateByPKey.setShort(argIdx++, MaxRetries);
        stmtCreateByPKey.setString(argIdx++, ToneSpec);
        stmtCreateByPKey.setString(argIdx++, CallbackDialplan);
        if (CallbackContext != null) {
            stmtCreateByPKey.setString(argIdx++, CallbackContext);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        stmtCreateByPKey.setString(argIdx++, PlayNewMessagesKey);
        stmtCreateByPKey.setString(argIdx++, PlaySavedMessagesKey);
        stmtCreateByPKey.setString(argIdx++, LoginKeys);
        stmtCreateByPKey.setString(argIdx++, MainMenuKey);
        stmtCreateByPKey.setString(argIdx++, ConfigMenuKey);
        stmtCreateByPKey.setString(argIdx++, RecordGreetingKey);
        stmtCreateByPKey.setString(argIdx++, ChooseGreetingKey);
        stmtCreateByPKey.setString(argIdx++, ChangePassKey);
        stmtCreateByPKey.setString(argIdx++, RecordNameKey);
        stmtCreateByPKey.setString(argIdx++, RecordFileKey);
        stmtCreateByPKey.setString(argIdx++, ListenFileKey);
        stmtCreateByPKey.setString(argIdx++, SaveFileKey);
        stmtCreateByPKey.setString(argIdx++, DeleteFileKey);
        stmtCreateByPKey.setString(argIdx++, UndeleteFileKey);
        stmtCreateByPKey.setString(argIdx++, EMailKey);
        stmtCreateByPKey.setString(argIdx++, PauseKey);
        stmtCreateByPKey.setString(argIdx++, RestartKey);
        stmtCreateByPKey.setString(argIdx++, FastForwardKey);
        stmtCreateByPKey.setString(argIdx++, RewindKey);
        stmtCreateByPKey.setString(argIdx++, SkipGreetKey);
        stmtCreateByPKey.setInt(argIdx++, RecordSilenceThreshold);
        stmtCreateByPKey.setShort(argIdx++, RecordSilenceHits);
        stmtCreateByPKey.setString(argIdx++, WebTemplateFile);
        stmtCreateByPKey.setInt(argIdx++, RecordSampleRate);
        stmtCreateByPKey.setString(argIdx++, OperatorExtension);
        stmtCreateByPKey.setString(argIdx++, VMainExtension);
        stmtCreateByPKey.setString(argIdx++, VMailKey);
        if (AutoPlaybackRecordings) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setString(argIdx++, StorageDir);
        if (OdbcDSN != null) {
            stmtCreateByPKey.setString(argIdx++, OdbcDSN);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (RecordComent != null) {
            stmtCreateByPKey.setString(argIdx++, RecordComent);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (RecordTitle != null) {
            stmtCreateByPKey.setString(argIdx++, RecordTitle);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (RecordCopyright != null) {
            stmtCreateByPKey.setString(argIdx++, RecordCopyright);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        stmtCreateByPKey.execute();
        resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
        if (resultSet == null) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_fssfvm() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFFswFSSFVMailBuff createdBuff = unpackFSSFVMailResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                Buff.setRequiredTenantId(createdBuff.getRequiredTenantId());
                Buff.setRequiredFSSFVMailId(createdBuff.getRequiredFSSFVMailId());
                Buff.setRequiredFSSofiaId(createdBuff.getRequiredFSSofiaId());
                Buff.setRequiredName(createdBuff.getRequiredName());
                Buff.setRequiredTemplateFile(createdBuff.getRequiredTemplateFile());
                Buff.setRequiredNotifyTemplateFile(createdBuff.getRequiredNotifyTemplateFile());
                Buff.setRequiredDateFmt(createdBuff.getRequiredDateFmt());
                Buff.setRequiredEmailFrom(createdBuff.getRequiredEmailFrom());
                Buff.setRequiredFileExtension(createdBuff.getRequiredFileExtension());
                Buff.setRequiredTerminatorKey(createdBuff.getRequiredTerminatorKey());
                Buff.setRequiredMaxLoginAttempts(createdBuff.getRequiredMaxLoginAttempts());
                Buff.setRequiredDigitTimeout(createdBuff.getRequiredDigitTimeout());
                Buff.setRequiredMinRecordLen(createdBuff.getRequiredMinRecordLen());
                Buff.setRequiredMaxRecordLen(createdBuff.getRequiredMaxRecordLen());
                Buff.setRequiredMaxRetries(createdBuff.getRequiredMaxRetries());
                Buff.setRequiredToneSpec(createdBuff.getRequiredToneSpec());
                Buff.setRequiredCallbackDialplan(createdBuff.getRequiredCallbackDialplan());
                Buff.setOptionalCallbackContext(createdBuff.getOptionalCallbackContext());
                Buff.setRequiredPlayNewMessagesKey(createdBuff.getRequiredPlayNewMessagesKey());
                Buff.setRequiredPlaySavedMessagesKey(createdBuff.getRequiredPlaySavedMessagesKey());
                Buff.setRequiredLoginKeys(createdBuff.getRequiredLoginKeys());
                Buff.setRequiredMainMenuKey(createdBuff.getRequiredMainMenuKey());
                Buff.setRequiredConfigMenuKey(createdBuff.getRequiredConfigMenuKey());
                Buff.setRequiredRecordGreetingKey(createdBuff.getRequiredRecordGreetingKey());
                Buff.setRequiredChooseGreetingKey(createdBuff.getRequiredChooseGreetingKey());
                Buff.setRequiredChangePassKey(createdBuff.getRequiredChangePassKey());
                Buff.setRequiredRecordNameKey(createdBuff.getRequiredRecordNameKey());
                Buff.setRequiredRecordFileKey(createdBuff.getRequiredRecordFileKey());
                Buff.setRequiredListenFileKey(createdBuff.getRequiredListenFileKey());
                Buff.setRequiredSaveFileKey(createdBuff.getRequiredSaveFileKey());
                Buff.setRequiredDeleteFileKey(createdBuff.getRequiredDeleteFileKey());
                Buff.setRequiredUndeleteFileKey(createdBuff.getRequiredUndeleteFileKey());
                Buff.setRequiredEMailKey(createdBuff.getRequiredEMailKey());
                Buff.setRequiredPauseKey(createdBuff.getRequiredPauseKey());
                Buff.setRequiredRestartKey(createdBuff.getRequiredRestartKey());
                Buff.setRequiredFastForwardKey(createdBuff.getRequiredFastForwardKey());
                Buff.setRequiredRewindKey(createdBuff.getRequiredRewindKey());
                Buff.setRequiredSkipGreetKey(createdBuff.getRequiredSkipGreetKey());
                Buff.setRequiredRecordSilenceThreshold(createdBuff.getRequiredRecordSilenceThreshold());
                Buff.setRequiredRecordSilenceHits(createdBuff.getRequiredRecordSilenceHits());
                Buff.setRequiredWebTemplateFile(createdBuff.getRequiredWebTemplateFile());
                Buff.setRequiredRecordSampleRate(createdBuff.getRequiredRecordSampleRate());
                Buff.setRequiredOperatorExtension(createdBuff.getRequiredOperatorExtension());
                Buff.setRequiredVMainExtension(createdBuff.getRequiredVMainExtension());
                Buff.setRequiredVMailKey(createdBuff.getRequiredVMailKey());
                Buff.setRequiredAutoPlaybackRecordings(createdBuff.getRequiredAutoPlaybackRecordings());
                Buff.setRequiredStorageDir(createdBuff.getRequiredStorageDir());
                Buff.setOptionalOdbcDSN(createdBuff.getOptionalOdbcDSN());
                Buff.setOptionalRecordComent(createdBuff.getOptionalRecordComent());
                Buff.setOptionalRecordTitle(createdBuff.getOptionalRecordTitle());
                Buff.setOptionalRecordCopyright(createdBuff.getOptionalRecordCopyright());
                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().newRuntimeException(getClass(), S_ProcName,
                    "crt_fssfvm() did not return a valid result set");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
        if (stmtCreateByPKey != null) {
            try {
                stmtCreateByPKey.close();
            } catch (SQLException e) {
            }
            stmtCreateByPKey = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswOracle.CFFswOracleFSSFVMailTable.java

public void updateFSSFVMail(CFFswAuthorization Authorization, CFFswFSSFVMailBuff Buff) {
    final String S_ProcName = "updateFSSFVMail";
    ResultSet resultSet = null;//  w w  w.j av  a2  s .com
    Connection cnx = schema.getCnx();
    CallableStatement stmtUpdateByPKey = null;
    List<CFFswFSSFVMailBuff> buffList = new LinkedList<CFFswFSSFVMailBuff>();
    try {
        long TenantId = Buff.getRequiredTenantId();
        long FSSFVMailId = Buff.getRequiredFSSFVMailId();
        long FSSofiaId = Buff.getRequiredFSSofiaId();
        String Name = Buff.getRequiredName();
        String TemplateFile = Buff.getRequiredTemplateFile();
        String NotifyTemplateFile = Buff.getRequiredNotifyTemplateFile();
        String DateFmt = Buff.getRequiredDateFmt();
        String EmailFrom = Buff.getRequiredEmailFrom();
        String FileExtension = Buff.getRequiredFileExtension();
        String TerminatorKey = Buff.getRequiredTerminatorKey();
        short MaxLoginAttempts = Buff.getRequiredMaxLoginAttempts();
        int DigitTimeout = Buff.getRequiredDigitTimeout();
        int MinRecordLen = Buff.getRequiredMinRecordLen();
        int MaxRecordLen = Buff.getRequiredMaxRecordLen();
        short MaxRetries = Buff.getRequiredMaxRetries();
        String ToneSpec = Buff.getRequiredToneSpec();
        String CallbackDialplan = Buff.getRequiredCallbackDialplan();
        String CallbackContext = Buff.getOptionalCallbackContext();
        String PlayNewMessagesKey = Buff.getRequiredPlayNewMessagesKey();
        String PlaySavedMessagesKey = Buff.getRequiredPlaySavedMessagesKey();
        String LoginKeys = Buff.getRequiredLoginKeys();
        String MainMenuKey = Buff.getRequiredMainMenuKey();
        String ConfigMenuKey = Buff.getRequiredConfigMenuKey();
        String RecordGreetingKey = Buff.getRequiredRecordGreetingKey();
        String ChooseGreetingKey = Buff.getRequiredChooseGreetingKey();
        String ChangePassKey = Buff.getRequiredChangePassKey();
        String RecordNameKey = Buff.getRequiredRecordNameKey();
        String RecordFileKey = Buff.getRequiredRecordFileKey();
        String ListenFileKey = Buff.getRequiredListenFileKey();
        String SaveFileKey = Buff.getRequiredSaveFileKey();
        String DeleteFileKey = Buff.getRequiredDeleteFileKey();
        String UndeleteFileKey = Buff.getRequiredUndeleteFileKey();
        String EMailKey = Buff.getRequiredEMailKey();
        String PauseKey = Buff.getRequiredPauseKey();
        String RestartKey = Buff.getRequiredRestartKey();
        String FastForwardKey = Buff.getRequiredFastForwardKey();
        String RewindKey = Buff.getRequiredRewindKey();
        String SkipGreetKey = Buff.getRequiredSkipGreetKey();
        int RecordSilenceThreshold = Buff.getRequiredRecordSilenceThreshold();
        short RecordSilenceHits = Buff.getRequiredRecordSilenceHits();
        String WebTemplateFile = Buff.getRequiredWebTemplateFile();
        int RecordSampleRate = Buff.getRequiredRecordSampleRate();
        String OperatorExtension = Buff.getRequiredOperatorExtension();
        String VMainExtension = Buff.getRequiredVMainExtension();
        String VMailKey = Buff.getRequiredVMailKey();
        boolean AutoPlaybackRecordings = Buff.getRequiredAutoPlaybackRecordings();
        String StorageDir = Buff.getRequiredStorageDir();
        String OdbcDSN = Buff.getOptionalOdbcDSN();
        String RecordComent = Buff.getOptionalRecordComent();
        String RecordTitle = Buff.getOptionalRecordTitle();
        String RecordCopyright = Buff.getOptionalRecordCopyright();
        int Revision = Buff.getRequiredRevision();
        stmtUpdateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".upd_fssfvm( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", "
                + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); end;");
        int argIdx = 1;
        stmtUpdateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        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++, "FSVM");
        stmtUpdateByPKey.setLong(argIdx++, TenantId);
        stmtUpdateByPKey.setLong(argIdx++, FSSFVMailId);
        stmtUpdateByPKey.setLong(argIdx++, FSSofiaId);
        stmtUpdateByPKey.setString(argIdx++, Name);
        stmtUpdateByPKey.setString(argIdx++, TemplateFile);
        stmtUpdateByPKey.setString(argIdx++, NotifyTemplateFile);
        stmtUpdateByPKey.setString(argIdx++, DateFmt);
        stmtUpdateByPKey.setString(argIdx++, EmailFrom);
        stmtUpdateByPKey.setString(argIdx++, FileExtension);
        stmtUpdateByPKey.setString(argIdx++, TerminatorKey);
        stmtUpdateByPKey.setShort(argIdx++, MaxLoginAttempts);
        stmtUpdateByPKey.setInt(argIdx++, DigitTimeout);
        stmtUpdateByPKey.setInt(argIdx++, MinRecordLen);
        stmtUpdateByPKey.setInt(argIdx++, MaxRecordLen);
        stmtUpdateByPKey.setShort(argIdx++, MaxRetries);
        stmtUpdateByPKey.setString(argIdx++, ToneSpec);
        stmtUpdateByPKey.setString(argIdx++, CallbackDialplan);
        if (CallbackContext != null) {
            stmtUpdateByPKey.setString(argIdx++, CallbackContext);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        stmtUpdateByPKey.setString(argIdx++, PlayNewMessagesKey);
        stmtUpdateByPKey.setString(argIdx++, PlaySavedMessagesKey);
        stmtUpdateByPKey.setString(argIdx++, LoginKeys);
        stmtUpdateByPKey.setString(argIdx++, MainMenuKey);
        stmtUpdateByPKey.setString(argIdx++, ConfigMenuKey);
        stmtUpdateByPKey.setString(argIdx++, RecordGreetingKey);
        stmtUpdateByPKey.setString(argIdx++, ChooseGreetingKey);
        stmtUpdateByPKey.setString(argIdx++, ChangePassKey);
        stmtUpdateByPKey.setString(argIdx++, RecordNameKey);
        stmtUpdateByPKey.setString(argIdx++, RecordFileKey);
        stmtUpdateByPKey.setString(argIdx++, ListenFileKey);
        stmtUpdateByPKey.setString(argIdx++, SaveFileKey);
        stmtUpdateByPKey.setString(argIdx++, DeleteFileKey);
        stmtUpdateByPKey.setString(argIdx++, UndeleteFileKey);
        stmtUpdateByPKey.setString(argIdx++, EMailKey);
        stmtUpdateByPKey.setString(argIdx++, PauseKey);
        stmtUpdateByPKey.setString(argIdx++, RestartKey);
        stmtUpdateByPKey.setString(argIdx++, FastForwardKey);
        stmtUpdateByPKey.setString(argIdx++, RewindKey);
        stmtUpdateByPKey.setString(argIdx++, SkipGreetKey);
        stmtUpdateByPKey.setInt(argIdx++, RecordSilenceThreshold);
        stmtUpdateByPKey.setShort(argIdx++, RecordSilenceHits);
        stmtUpdateByPKey.setString(argIdx++, WebTemplateFile);
        stmtUpdateByPKey.setInt(argIdx++, RecordSampleRate);
        stmtUpdateByPKey.setString(argIdx++, OperatorExtension);
        stmtUpdateByPKey.setString(argIdx++, VMainExtension);
        stmtUpdateByPKey.setString(argIdx++, VMailKey);
        if (AutoPlaybackRecordings) {
            stmtUpdateByPKey.setString(argIdx++, "Y");
        } else {
            stmtUpdateByPKey.setString(argIdx++, "N");
        }
        stmtUpdateByPKey.setString(argIdx++, StorageDir);
        if (OdbcDSN != null) {
            stmtUpdateByPKey.setString(argIdx++, OdbcDSN);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (RecordComent != null) {
            stmtUpdateByPKey.setString(argIdx++, RecordComent);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (RecordTitle != null) {
            stmtUpdateByPKey.setString(argIdx++, RecordTitle);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (RecordCopyright != null) {
            stmtUpdateByPKey.setString(argIdx++, RecordCopyright);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        stmtUpdateByPKey.setInt(argIdx++, Revision);
        stmtUpdateByPKey.execute();
        resultSet = (ResultSet) stmtUpdateByPKey.getObject(1);
        if (resultSet != null) {
            try {
                if (resultSet.next()) {
                    CFFswFSSFVMailBuff updatedBuff = unpackFSSFVMailResultSetToBuff(resultSet);
                    if (resultSet.next()) {
                        resultSet.last();
                        throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                                "Did not expect multi-record response, " + resultSet.getRow()
                                        + " rows selected");
                    }
                    Buff.setRequiredFSSofiaId(updatedBuff.getRequiredFSSofiaId());
                    Buff.setRequiredName(updatedBuff.getRequiredName());
                    Buff.setRequiredTemplateFile(updatedBuff.getRequiredTemplateFile());
                    Buff.setRequiredNotifyTemplateFile(updatedBuff.getRequiredNotifyTemplateFile());
                    Buff.setRequiredDateFmt(updatedBuff.getRequiredDateFmt());
                    Buff.setRequiredEmailFrom(updatedBuff.getRequiredEmailFrom());
                    Buff.setRequiredFileExtension(updatedBuff.getRequiredFileExtension());
                    Buff.setRequiredTerminatorKey(updatedBuff.getRequiredTerminatorKey());
                    Buff.setRequiredMaxLoginAttempts(updatedBuff.getRequiredMaxLoginAttempts());
                    Buff.setRequiredDigitTimeout(updatedBuff.getRequiredDigitTimeout());
                    Buff.setRequiredMinRecordLen(updatedBuff.getRequiredMinRecordLen());
                    Buff.setRequiredMaxRecordLen(updatedBuff.getRequiredMaxRecordLen());
                    Buff.setRequiredMaxRetries(updatedBuff.getRequiredMaxRetries());
                    Buff.setRequiredToneSpec(updatedBuff.getRequiredToneSpec());
                    Buff.setRequiredCallbackDialplan(updatedBuff.getRequiredCallbackDialplan());
                    Buff.setOptionalCallbackContext(updatedBuff.getOptionalCallbackContext());
                    Buff.setRequiredPlayNewMessagesKey(updatedBuff.getRequiredPlayNewMessagesKey());
                    Buff.setRequiredPlaySavedMessagesKey(updatedBuff.getRequiredPlaySavedMessagesKey());
                    Buff.setRequiredLoginKeys(updatedBuff.getRequiredLoginKeys());
                    Buff.setRequiredMainMenuKey(updatedBuff.getRequiredMainMenuKey());
                    Buff.setRequiredConfigMenuKey(updatedBuff.getRequiredConfigMenuKey());
                    Buff.setRequiredRecordGreetingKey(updatedBuff.getRequiredRecordGreetingKey());
                    Buff.setRequiredChooseGreetingKey(updatedBuff.getRequiredChooseGreetingKey());
                    Buff.setRequiredChangePassKey(updatedBuff.getRequiredChangePassKey());
                    Buff.setRequiredRecordNameKey(updatedBuff.getRequiredRecordNameKey());
                    Buff.setRequiredRecordFileKey(updatedBuff.getRequiredRecordFileKey());
                    Buff.setRequiredListenFileKey(updatedBuff.getRequiredListenFileKey());
                    Buff.setRequiredSaveFileKey(updatedBuff.getRequiredSaveFileKey());
                    Buff.setRequiredDeleteFileKey(updatedBuff.getRequiredDeleteFileKey());
                    Buff.setRequiredUndeleteFileKey(updatedBuff.getRequiredUndeleteFileKey());
                    Buff.setRequiredEMailKey(updatedBuff.getRequiredEMailKey());
                    Buff.setRequiredPauseKey(updatedBuff.getRequiredPauseKey());
                    Buff.setRequiredRestartKey(updatedBuff.getRequiredRestartKey());
                    Buff.setRequiredFastForwardKey(updatedBuff.getRequiredFastForwardKey());
                    Buff.setRequiredRewindKey(updatedBuff.getRequiredRewindKey());
                    Buff.setRequiredSkipGreetKey(updatedBuff.getRequiredSkipGreetKey());
                    Buff.setRequiredRecordSilenceThreshold(updatedBuff.getRequiredRecordSilenceThreshold());
                    Buff.setRequiredRecordSilenceHits(updatedBuff.getRequiredRecordSilenceHits());
                    Buff.setRequiredWebTemplateFile(updatedBuff.getRequiredWebTemplateFile());
                    Buff.setRequiredRecordSampleRate(updatedBuff.getRequiredRecordSampleRate());
                    Buff.setRequiredOperatorExtension(updatedBuff.getRequiredOperatorExtension());
                    Buff.setRequiredVMainExtension(updatedBuff.getRequiredVMainExtension());
                    Buff.setRequiredVMailKey(updatedBuff.getRequiredVMailKey());
                    Buff.setRequiredAutoPlaybackRecordings(updatedBuff.getRequiredAutoPlaybackRecordings());
                    Buff.setRequiredStorageDir(updatedBuff.getRequiredStorageDir());
                    Buff.setOptionalOdbcDSN(updatedBuff.getOptionalOdbcDSN());
                    Buff.setOptionalRecordComent(updatedBuff.getOptionalRecordComent());
                    Buff.setOptionalRecordTitle(updatedBuff.getOptionalRecordTitle());
                    Buff.setOptionalRecordCopyright(updatedBuff.getOptionalRecordCopyright());
                    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().newRuntimeException(getClass(), S_ProcName,
                        "upd_fssfvm() did not return a valid result cursor");
            } finally {
                if (resultSet != null) {
                    try {
                        resultSet.close();
                    } catch (SQLException e) {
                    }
                    resultSet = null;
                }
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "upd_fssfvm() did not return a result cursor");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
        if (stmtUpdateByPKey != null) {
            try {
                stmtUpdateByPKey.close();
            } catch (SQLException e) {
            }
            stmtUpdateByPKey = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswOracle.CFFswOracleFSSFProfileTable.java

public void createFSSFProfile(CFFswAuthorization Authorization, CFFswFSSFProfileBuff Buff) {
    final String S_ProcName = "createFSSFProfile";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }// w  w  w.  j  av a 2 s . com
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        long TenantId = Buff.getRequiredTenantId();
        long FSSFProfileId = Buff.getRequiredFSSFProfileId();
        long FSSofiaId = Buff.getRequiredFSSofiaId();
        String Name = Buff.getRequiredName();
        short Debug = Buff.getRequiredDebug();
        boolean SipTrace = Buff.getRequiredSipTrace();
        short SipPort = Buff.getRequiredSipPort();
        String Dialplan = Buff.getRequiredDialplan();
        String Context = Buff.getRequiredContext();
        int DTMFDuration = Buff.getRequiredDTMFDuration();
        String CodecPrefs = Buff.getRequiredCodecPrefs();
        String HoldMusic = Buff.getRequiredHoldMusic();
        String RTPTimerName = Buff.getRequiredRTPTimerName();
        boolean Enable100Rel = Buff.getRequiredEnable100Rel();
        boolean ManagePresence = Buff.getRequiredManagePresence();
        String DbName = Buff.getOptionalDbName();
        String PresenceHosts = Buff.getRequiredPresenceHosts();
        String ForceRegisterDomain = Buff.getRequiredForceRegisterDomain();
        String ForceRegisterDbDomain = Buff.getOptionalForceRegisterDbDomain();
        boolean AggressiveNATDetection = Buff.getRequiredAggressiveNATDetection();
        String InboundCodecNegotiation = Buff.getRequiredInboundCodecNegotiation();
        short NonCETTL = Buff.getRequiredNonCETTL();
        boolean AuthCalls = Buff.getRequiredAuthCalls();
        int RtpTimeoutSec = Buff.getRequiredRtpTimeoutSec();
        String RtpIP = Buff.getRequiredRtpIP();
        String SipIP = Buff.getRequiredSipIP();
        String ExtRtpIP = Buff.getRequiredExtRtpIP();
        String ExtSipIP = Buff.getRequiredExtSipIP();
        boolean Enable3PCC = Buff.getRequiredEnable3PCC();
        String TlsBindParams = Buff.getRequiredTlsBindParams();
        short TlsSipPort = Buff.getRequiredTlsSipPort();
        String TlsCertDir = Buff.getRequiredTlsCertDir();
        String TlsVersion = Buff.getRequiredTlsVersion();
        boolean RtpAutoflushDuringBridge = Buff.getRequiredRtpAutoflushDuringBridge();
        boolean RtpRewriteTimestamp = Buff.getRequiredRtpRewriteTimestamp();
        boolean PassRFC2833 = Buff.getRequiredPassRFC2833();
        String OdbcDSN = Buff.getOptionalOdbcDSN();
        boolean InboundBypassMedia = Buff.getRequiredInboundBypassMedia();
        boolean InboundProxyMedia = Buff.getRequiredInboundProxyMedia();
        boolean InboundLateNegotiation = Buff.getRequiredInboundLateNegotiation();
        boolean AcceptBlindReg = Buff.getRequiredAcceptBlindReg();
        boolean AcceptBlindAuth = Buff.getRequiredAcceptBlindAuth();
        boolean SuppressCNG = Buff.getRequiredSuppressCNG();
        boolean DisableTranscoding = Buff.getRequiredDisableTranscoding();
        boolean DisableTransfer = Buff.getRequiredDisableTransfer();
        boolean NDLBBrokenAuthHash = Buff.getRequiredNDLBBrokenAuthHash();
        boolean NDLBReceivedInNATRegContact = Buff.getRequiredNDLBReceivedInNATRegContact();
        boolean InboundRegForceMatchingUsername = Buff.getRequiredInboundRegForceMatchingUsername();
        boolean AuthAllPackets = Buff.getRequiredAuthAllPackets();
        String Vad = Buff.getRequiredVad();
        String Alias = Buff.getRequiredAlias();
        int ForceSubscriptionExpires = Buff.getRequiredForceSubscriptionExpires();
        boolean DisableRegister = Buff.getRequiredDisableRegister();
        boolean NDLBForceReport = Buff.getRequiredNDLBForceReport();
        String ChallengeRealm = Buff.getRequiredChallengeRealm();
        boolean DisableRtpAutoAdjust = Buff.getRequiredDisableRtpAutoAdjust();
        boolean InboundUseCallIdAsUUID = Buff.getRequiredInboundUseCallIdAsUUID();
        boolean OutboundUseUUIDAsCallId = Buff.getRequiredOutboundUseUUIDAsCallId();
        boolean RtpAutofixTiming = Buff.getRequiredRtpAutofixTiming();
        String AutoRtpBugs = Buff.getRequiredAutoRtpBugs();
        boolean DisableSrv = Buff.getRequiredDisableSrv();
        boolean DisableNAPtr = Buff.getRequiredDisableNAPtr();
        int TimerT1 = Buff.getRequiredTimerT1();
        int TimerT1X64 = Buff.getRequiredTimerT1X64();
        int TimerT2 = Buff.getRequiredTimerT2();
        int TimerT4 = Buff.getRequiredTimerT4();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".crt_fssfprofile( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        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++, "FSPF");
        stmtCreateByPKey.setLong(argIdx++, TenantId);
        stmtCreateByPKey.setLong(argIdx++, FSSFProfileId);
        stmtCreateByPKey.setLong(argIdx++, FSSofiaId);
        stmtCreateByPKey.setString(argIdx++, Name);
        stmtCreateByPKey.setShort(argIdx++, Debug);
        if (SipTrace) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setShort(argIdx++, SipPort);
        stmtCreateByPKey.setString(argIdx++, Dialplan);
        stmtCreateByPKey.setString(argIdx++, Context);
        stmtCreateByPKey.setInt(argIdx++, DTMFDuration);
        stmtCreateByPKey.setString(argIdx++, CodecPrefs);
        stmtCreateByPKey.setString(argIdx++, HoldMusic);
        stmtCreateByPKey.setString(argIdx++, RTPTimerName);
        if (Enable100Rel) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (ManagePresence) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (DbName != null) {
            stmtCreateByPKey.setString(argIdx++, DbName);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        stmtCreateByPKey.setString(argIdx++, PresenceHosts);
        stmtCreateByPKey.setString(argIdx++, ForceRegisterDomain);
        if (ForceRegisterDbDomain != null) {
            stmtCreateByPKey.setString(argIdx++, ForceRegisterDbDomain);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (AggressiveNATDetection) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setString(argIdx++, InboundCodecNegotiation);
        stmtCreateByPKey.setShort(argIdx++, NonCETTL);
        if (AuthCalls) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setInt(argIdx++, RtpTimeoutSec);
        stmtCreateByPKey.setString(argIdx++, RtpIP);
        stmtCreateByPKey.setString(argIdx++, SipIP);
        stmtCreateByPKey.setString(argIdx++, ExtRtpIP);
        stmtCreateByPKey.setString(argIdx++, ExtSipIP);
        if (Enable3PCC) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setString(argIdx++, TlsBindParams);
        stmtCreateByPKey.setShort(argIdx++, TlsSipPort);
        stmtCreateByPKey.setString(argIdx++, TlsCertDir);
        stmtCreateByPKey.setString(argIdx++, TlsVersion);
        if (RtpAutoflushDuringBridge) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (RtpRewriteTimestamp) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (PassRFC2833) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (OdbcDSN != null) {
            stmtCreateByPKey.setString(argIdx++, OdbcDSN);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (InboundBypassMedia) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (InboundProxyMedia) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (InboundLateNegotiation) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (AcceptBlindReg) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (AcceptBlindAuth) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (SuppressCNG) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (DisableTranscoding) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (DisableTransfer) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (NDLBBrokenAuthHash) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (NDLBReceivedInNATRegContact) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (InboundRegForceMatchingUsername) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (AuthAllPackets) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setString(argIdx++, Vad);
        stmtCreateByPKey.setString(argIdx++, Alias);
        stmtCreateByPKey.setInt(argIdx++, ForceSubscriptionExpires);
        if (DisableRegister) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (NDLBForceReport) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setString(argIdx++, ChallengeRealm);
        if (DisableRtpAutoAdjust) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (InboundUseCallIdAsUUID) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (OutboundUseUUIDAsCallId) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (RtpAutofixTiming) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setString(argIdx++, AutoRtpBugs);
        if (DisableSrv) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        if (DisableNAPtr) {
            stmtCreateByPKey.setString(argIdx++, "Y");
        } else {
            stmtCreateByPKey.setString(argIdx++, "N");
        }
        stmtCreateByPKey.setInt(argIdx++, TimerT1);
        stmtCreateByPKey.setInt(argIdx++, TimerT1X64);
        stmtCreateByPKey.setInt(argIdx++, TimerT2);
        stmtCreateByPKey.setInt(argIdx++, TimerT4);
        stmtCreateByPKey.execute();
        resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
        if (resultSet == null) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_fssfprofile() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFFswFSSFProfileBuff createdBuff = unpackFSSFProfileResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                Buff.setRequiredTenantId(createdBuff.getRequiredTenantId());
                Buff.setRequiredFSSFProfileId(createdBuff.getRequiredFSSFProfileId());
                Buff.setRequiredFSSofiaId(createdBuff.getRequiredFSSofiaId());
                Buff.setRequiredName(createdBuff.getRequiredName());
                Buff.setRequiredDebug(createdBuff.getRequiredDebug());
                Buff.setRequiredSipTrace(createdBuff.getRequiredSipTrace());
                Buff.setRequiredSipPort(createdBuff.getRequiredSipPort());
                Buff.setRequiredDialplan(createdBuff.getRequiredDialplan());
                Buff.setRequiredContext(createdBuff.getRequiredContext());
                Buff.setRequiredDTMFDuration(createdBuff.getRequiredDTMFDuration());
                Buff.setRequiredCodecPrefs(createdBuff.getRequiredCodecPrefs());
                Buff.setRequiredHoldMusic(createdBuff.getRequiredHoldMusic());
                Buff.setRequiredRTPTimerName(createdBuff.getRequiredRTPTimerName());
                Buff.setRequiredEnable100Rel(createdBuff.getRequiredEnable100Rel());
                Buff.setRequiredManagePresence(createdBuff.getRequiredManagePresence());
                Buff.setOptionalDbName(createdBuff.getOptionalDbName());
                Buff.setRequiredPresenceHosts(createdBuff.getRequiredPresenceHosts());
                Buff.setRequiredForceRegisterDomain(createdBuff.getRequiredForceRegisterDomain());
                Buff.setOptionalForceRegisterDbDomain(createdBuff.getOptionalForceRegisterDbDomain());
                Buff.setRequiredAggressiveNATDetection(createdBuff.getRequiredAggressiveNATDetection());
                Buff.setRequiredInboundCodecNegotiation(createdBuff.getRequiredInboundCodecNegotiation());
                Buff.setRequiredNonCETTL(createdBuff.getRequiredNonCETTL());
                Buff.setRequiredAuthCalls(createdBuff.getRequiredAuthCalls());
                Buff.setRequiredRtpTimeoutSec(createdBuff.getRequiredRtpTimeoutSec());
                Buff.setRequiredRtpIP(createdBuff.getRequiredRtpIP());
                Buff.setRequiredSipIP(createdBuff.getRequiredSipIP());
                Buff.setRequiredExtRtpIP(createdBuff.getRequiredExtRtpIP());
                Buff.setRequiredExtSipIP(createdBuff.getRequiredExtSipIP());
                Buff.setRequiredEnable3PCC(createdBuff.getRequiredEnable3PCC());
                Buff.setRequiredTlsBindParams(createdBuff.getRequiredTlsBindParams());
                Buff.setRequiredTlsSipPort(createdBuff.getRequiredTlsSipPort());
                Buff.setRequiredTlsCertDir(createdBuff.getRequiredTlsCertDir());
                Buff.setRequiredTlsVersion(createdBuff.getRequiredTlsVersion());
                Buff.setRequiredRtpAutoflushDuringBridge(createdBuff.getRequiredRtpAutoflushDuringBridge());
                Buff.setRequiredRtpRewriteTimestamp(createdBuff.getRequiredRtpRewriteTimestamp());
                Buff.setRequiredPassRFC2833(createdBuff.getRequiredPassRFC2833());
                Buff.setOptionalOdbcDSN(createdBuff.getOptionalOdbcDSN());
                Buff.setRequiredInboundBypassMedia(createdBuff.getRequiredInboundBypassMedia());
                Buff.setRequiredInboundProxyMedia(createdBuff.getRequiredInboundProxyMedia());
                Buff.setRequiredInboundLateNegotiation(createdBuff.getRequiredInboundLateNegotiation());
                Buff.setRequiredAcceptBlindReg(createdBuff.getRequiredAcceptBlindReg());
                Buff.setRequiredAcceptBlindAuth(createdBuff.getRequiredAcceptBlindAuth());
                Buff.setRequiredSuppressCNG(createdBuff.getRequiredSuppressCNG());
                Buff.setRequiredDisableTranscoding(createdBuff.getRequiredDisableTranscoding());
                Buff.setRequiredDisableTransfer(createdBuff.getRequiredDisableTransfer());
                Buff.setRequiredNDLBBrokenAuthHash(createdBuff.getRequiredNDLBBrokenAuthHash());
                Buff.setRequiredNDLBReceivedInNATRegContact(
                        createdBuff.getRequiredNDLBReceivedInNATRegContact());
                Buff.setRequiredInboundRegForceMatchingUsername(
                        createdBuff.getRequiredInboundRegForceMatchingUsername());
                Buff.setRequiredAuthAllPackets(createdBuff.getRequiredAuthAllPackets());
                Buff.setRequiredVad(createdBuff.getRequiredVad());
                Buff.setRequiredAlias(createdBuff.getRequiredAlias());
                Buff.setRequiredForceSubscriptionExpires(createdBuff.getRequiredForceSubscriptionExpires());
                Buff.setRequiredDisableRegister(createdBuff.getRequiredDisableRegister());
                Buff.setRequiredNDLBForceReport(createdBuff.getRequiredNDLBForceReport());
                Buff.setRequiredChallengeRealm(createdBuff.getRequiredChallengeRealm());
                Buff.setRequiredDisableRtpAutoAdjust(createdBuff.getRequiredDisableRtpAutoAdjust());
                Buff.setRequiredInboundUseCallIdAsUUID(createdBuff.getRequiredInboundUseCallIdAsUUID());
                Buff.setRequiredOutboundUseUUIDAsCallId(createdBuff.getRequiredOutboundUseUUIDAsCallId());
                Buff.setRequiredRtpAutofixTiming(createdBuff.getRequiredRtpAutofixTiming());
                Buff.setRequiredAutoRtpBugs(createdBuff.getRequiredAutoRtpBugs());
                Buff.setRequiredDisableSrv(createdBuff.getRequiredDisableSrv());
                Buff.setRequiredDisableNAPtr(createdBuff.getRequiredDisableNAPtr());
                Buff.setRequiredTimerT1(createdBuff.getRequiredTimerT1());
                Buff.setRequiredTimerT1X64(createdBuff.getRequiredTimerT1X64());
                Buff.setRequiredTimerT2(createdBuff.getRequiredTimerT2());
                Buff.setRequiredTimerT4(createdBuff.getRequiredTimerT4());
                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().newRuntimeException(getClass(), S_ProcName,
                    "crt_fssfprofile() did not return a valid result set");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
        if (stmtCreateByPKey != null) {
            try {
                stmtCreateByPKey.close();
            } catch (SQLException e) {
            }
            stmtCreateByPKey = null;
        }
    }
}