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.CFAccOracleContactTable.java

public void createContact(CFAccAuthorization Authorization, CFAccContactBuff Buff) {
    final String S_ProcName = "createContact";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//  w  ww.ja  va 2 s  .  c o  m
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        long TenantId = Buff.getRequiredTenantId();
        long ContactListId = Buff.getRequiredContactListId();
        Short ISOTimezoneId = Buff.getOptionalISOTimezoneId();
        String FullName = Buff.getRequiredFullName();
        String LastName = Buff.getOptionalLastName();
        String FirstName = Buff.getOptionalFirstName();
        String Custom = Buff.getOptionalCustom();
        String Custom2 = Buff.getOptionalCustom2();
        String Custom3 = Buff.getOptionalCustom3();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".crt_contact( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", "
                + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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++, "CTC");
        stmtCreateByPKey.setLong(argIdx++, TenantId);
        stmtCreateByPKey.setLong(argIdx++, ContactListId);
        if (ISOTimezoneId != null) {
            stmtCreateByPKey.setShort(argIdx++, ISOTimezoneId.shortValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        stmtCreateByPKey.setString(argIdx++, FullName);
        if (LastName != null) {
            stmtCreateByPKey.setString(argIdx++, LastName);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (FirstName != null) {
            stmtCreateByPKey.setString(argIdx++, FirstName);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (Custom != null) {
            stmtCreateByPKey.setString(argIdx++, Custom);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (Custom2 != null) {
            stmtCreateByPKey.setString(argIdx++, Custom2);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (Custom3 != null) {
            stmtCreateByPKey.setString(argIdx++, Custom3);
        } 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_contact() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFAccContactBuff createdBuff = unpackContactResultSetToBuff(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.setRequiredContactId(createdBuff.getRequiredContactId());
                Buff.setRequiredContactListId(createdBuff.getRequiredContactListId());
                Buff.setOptionalISOTimezoneId(createdBuff.getOptionalISOTimezoneId());
                Buff.setRequiredFullName(createdBuff.getRequiredFullName());
                Buff.setOptionalLastName(createdBuff.getOptionalLastName());
                Buff.setOptionalFirstName(createdBuff.getOptionalFirstName());
                Buff.setOptionalCustom(createdBuff.getOptionalCustom());
                Buff.setOptionalCustom2(createdBuff.getOptionalCustom2());
                Buff.setOptionalCustom3(createdBuff.getOptionalCustom3());
                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_contact() 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.CFAccOracleAccountTable.java

public void updateAccount(CFAccAuthorization Authorization, CFAccAccountBuff Buff) {
    final String S_ProcName = "updateAccount";
    ResultSet resultSet = null;//from www  . j av a2s  .  c  om
    Connection cnx = schema.getCnx();
    CallableStatement stmtUpdateByPKey = null;
    List<CFAccAccountBuff> buffList = new LinkedList<CFAccAccountBuff>();
    try {
        long TenantId = Buff.getRequiredTenantId();
        long Id = Buff.getRequiredId();
        String AccountCode = Buff.getRequiredAccountCode();
        String Description = Buff.getRequiredDescription();
        short CurrencyId = Buff.getRequiredCurrencyId();
        BigDecimal Balance = Buff.getRequiredBalance();
        Long RollupTenantId = Buff.getOptionalRollupTenantId();
        Long RollupAccountId = Buff.getOptionalRollupAccountId();
        int Revision = Buff.getRequiredRevision();
        stmtUpdateByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".upd_acct( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", "
                + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); 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++, "ACCT");
        stmtUpdateByPKey.setLong(argIdx++, TenantId);
        stmtUpdateByPKey.setLong(argIdx++, Id);
        stmtUpdateByPKey.setString(argIdx++, AccountCode);
        stmtUpdateByPKey.setString(argIdx++, Description);
        stmtUpdateByPKey.setShort(argIdx++, CurrencyId);
        stmtUpdateByPKey.setBigDecimal(argIdx++, Balance);
        if (RollupTenantId != null) {
            stmtUpdateByPKey.setLong(argIdx++, RollupTenantId.longValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (RollupAccountId != null) {
            stmtUpdateByPKey.setLong(argIdx++, RollupAccountId.longValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        stmtUpdateByPKey.setInt(argIdx++, Revision);
        stmtUpdateByPKey.execute();
        resultSet = (ResultSet) stmtUpdateByPKey.getObject(1);
        if (resultSet != null) {
            try {
                if (resultSet.next()) {
                    CFAccAccountBuff updatedBuff = unpackAccountResultSetToBuff(resultSet);
                    if (resultSet.next()) {
                        resultSet.last();
                        throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                                "Did not expect multi-record response, " + resultSet.getRow()
                                        + " rows selected");
                    }
                    Buff.setRequiredAccountCode(updatedBuff.getRequiredAccountCode());
                    Buff.setRequiredDescription(updatedBuff.getRequiredDescription());
                    Buff.setRequiredCurrencyId(updatedBuff.getRequiredCurrencyId());
                    Buff.setRequiredBalance(updatedBuff.getRequiredBalance());
                    Buff.setOptionalRollupTenantId(updatedBuff.getOptionalRollupTenantId());
                    Buff.setOptionalRollupAccountId(updatedBuff.getOptionalRollupAccountId());
                    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_acct() 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_acct() 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.cfacc.v2_0.CFAccOracle.CFAccOracleAccountConfigTable.java

public void createAccountConfig(CFAccAuthorization Authorization, CFAccAccountConfigBuff Buff) {
    final String S_ProcName = "createAccountConfig";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/* ww  w. j a  v a  2s .com*/
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        long TenantId = Buff.getRequiredTenantId();
        short DefaultCurrencyId = Buff.getRequiredDefaultCurrencyId();
        Long CustContactListTenantId = Buff.getOptionalCustContactListTenantId();
        Long CustContactListId = Buff.getOptionalCustContactListId();
        Long EmpContactListTenantId = Buff.getOptionalEmpContactListTenantId();
        Long EmpContactListId = Buff.getOptionalEmpContactListId();
        Long VendContactListTenantId = Buff.getOptionalVendContactListTenantId();
        Long VendContactListId = Buff.getOptionalVendContactListId();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".crt_acct_cfg( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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++, "ACFG");
        stmtCreateByPKey.setLong(argIdx++, TenantId);
        stmtCreateByPKey.setShort(argIdx++, DefaultCurrencyId);
        if (CustContactListTenantId != null) {
            stmtCreateByPKey.setLong(argIdx++, CustContactListTenantId.longValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (CustContactListId != null) {
            stmtCreateByPKey.setLong(argIdx++, CustContactListId.longValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (EmpContactListTenantId != null) {
            stmtCreateByPKey.setLong(argIdx++, EmpContactListTenantId.longValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (EmpContactListId != null) {
            stmtCreateByPKey.setLong(argIdx++, EmpContactListId.longValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (VendContactListTenantId != null) {
            stmtCreateByPKey.setLong(argIdx++, VendContactListTenantId.longValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (VendContactListId != null) {
            stmtCreateByPKey.setLong(argIdx++, VendContactListId.longValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        stmtCreateByPKey.execute();
        resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
        if (resultSet == null) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_acct_cfg() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFAccAccountConfigBuff createdBuff = unpackAccountConfigResultSetToBuff(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.setRequiredDefaultCurrencyId(createdBuff.getRequiredDefaultCurrencyId());
                Buff.setOptionalCustContactListTenantId(createdBuff.getOptionalCustContactListTenantId());
                Buff.setOptionalCustContactListId(createdBuff.getOptionalCustContactListId());
                Buff.setOptionalEmpContactListTenantId(createdBuff.getOptionalEmpContactListTenantId());
                Buff.setOptionalEmpContactListId(createdBuff.getOptionalEmpContactListId());
                Buff.setOptionalVendContactListTenantId(createdBuff.getOptionalVendContactListTenantId());
                Buff.setOptionalVendContactListId(createdBuff.getOptionalVendContactListId());
                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_acct_cfg() 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.CFAccOracleContactTable.java

public void updateContact(CFAccAuthorization Authorization, CFAccContactBuff Buff) {
    final String S_ProcName = "updateContact";
    ResultSet resultSet = null;//from   w ww  . ja va  2  s. c  om
    Connection cnx = schema.getCnx();
    CallableStatement stmtUpdateByPKey = null;
    List<CFAccContactBuff> buffList = new LinkedList<CFAccContactBuff>();
    try {
        long TenantId = Buff.getRequiredTenantId();
        long ContactId = Buff.getRequiredContactId();
        long ContactListId = Buff.getRequiredContactListId();
        Short ISOTimezoneId = Buff.getOptionalISOTimezoneId();
        String FullName = Buff.getRequiredFullName();
        String LastName = Buff.getOptionalLastName();
        String FirstName = Buff.getOptionalFirstName();
        String Custom = Buff.getOptionalCustom();
        String Custom2 = Buff.getOptionalCustom2();
        String Custom3 = Buff.getOptionalCustom3();
        int Revision = Buff.getRequiredRevision();
        stmtUpdateByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".upd_contact( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", "
                + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); 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++, "CTC");
        stmtUpdateByPKey.setLong(argIdx++, TenantId);
        stmtUpdateByPKey.setLong(argIdx++, ContactId);
        stmtUpdateByPKey.setLong(argIdx++, ContactListId);
        if (ISOTimezoneId != null) {
            stmtUpdateByPKey.setShort(argIdx++, ISOTimezoneId.shortValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        stmtUpdateByPKey.setString(argIdx++, FullName);
        if (LastName != null) {
            stmtUpdateByPKey.setString(argIdx++, LastName);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (FirstName != null) {
            stmtUpdateByPKey.setString(argIdx++, FirstName);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (Custom != null) {
            stmtUpdateByPKey.setString(argIdx++, Custom);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (Custom2 != null) {
            stmtUpdateByPKey.setString(argIdx++, Custom2);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (Custom3 != null) {
            stmtUpdateByPKey.setString(argIdx++, Custom3);
        } 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()) {
                    CFAccContactBuff updatedBuff = unpackContactResultSetToBuff(resultSet);
                    if (resultSet.next()) {
                        resultSet.last();
                        throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                                "Did not expect multi-record response, " + resultSet.getRow()
                                        + " rows selected");
                    }
                    Buff.setRequiredContactListId(updatedBuff.getRequiredContactListId());
                    Buff.setOptionalISOTimezoneId(updatedBuff.getOptionalISOTimezoneId());
                    Buff.setRequiredFullName(updatedBuff.getRequiredFullName());
                    Buff.setOptionalLastName(updatedBuff.getOptionalLastName());
                    Buff.setOptionalFirstName(updatedBuff.getOptionalFirstName());
                    Buff.setOptionalCustom(updatedBuff.getOptionalCustom());
                    Buff.setOptionalCustom2(updatedBuff.getOptionalCustom2());
                    Buff.setOptionalCustom3(updatedBuff.getOptionalCustom3());
                    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_contact() 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_contact() 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.cfacc.v2_0.CFAccOracle.CFAccOracleAccountConfigTable.java

public void updateAccountConfig(CFAccAuthorization Authorization, CFAccAccountConfigBuff Buff) {
    final String S_ProcName = "updateAccountConfig";
    ResultSet resultSet = null;//  w  w w  .  j  a  v  a2 s .c  o  m
    Connection cnx = schema.getCnx();
    CallableStatement stmtUpdateByPKey = null;
    List<CFAccAccountConfigBuff> buffList = new LinkedList<CFAccAccountConfigBuff>();
    try {
        long TenantId = Buff.getRequiredTenantId();
        short DefaultCurrencyId = Buff.getRequiredDefaultCurrencyId();
        Long CustContactListTenantId = Buff.getOptionalCustContactListTenantId();
        Long CustContactListId = Buff.getOptionalCustContactListId();
        Long EmpContactListTenantId = Buff.getOptionalEmpContactListTenantId();
        Long EmpContactListId = Buff.getOptionalEmpContactListId();
        Long VendContactListTenantId = Buff.getOptionalVendContactListTenantId();
        Long VendContactListId = Buff.getOptionalVendContactListId();
        int Revision = Buff.getRequiredRevision();
        stmtUpdateByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".upd_acct_cfg( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); 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++, "ACFG");
        stmtUpdateByPKey.setLong(argIdx++, TenantId);
        stmtUpdateByPKey.setShort(argIdx++, DefaultCurrencyId);
        if (CustContactListTenantId != null) {
            stmtUpdateByPKey.setLong(argIdx++, CustContactListTenantId.longValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (CustContactListId != null) {
            stmtUpdateByPKey.setLong(argIdx++, CustContactListId.longValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (EmpContactListTenantId != null) {
            stmtUpdateByPKey.setLong(argIdx++, EmpContactListTenantId.longValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (EmpContactListId != null) {
            stmtUpdateByPKey.setLong(argIdx++, EmpContactListId.longValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (VendContactListTenantId != null) {
            stmtUpdateByPKey.setLong(argIdx++, VendContactListTenantId.longValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (VendContactListId != null) {
            stmtUpdateByPKey.setLong(argIdx++, VendContactListId.longValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        stmtUpdateByPKey.setInt(argIdx++, Revision);
        stmtUpdateByPKey.execute();
        resultSet = (ResultSet) stmtUpdateByPKey.getObject(1);
        if (resultSet != null) {
            try {
                if (resultSet.next()) {
                    CFAccAccountConfigBuff updatedBuff = unpackAccountConfigResultSetToBuff(resultSet);
                    if (resultSet.next()) {
                        resultSet.last();
                        throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                                "Did not expect multi-record response, " + resultSet.getRow()
                                        + " rows selected");
                    }
                    Buff.setRequiredDefaultCurrencyId(updatedBuff.getRequiredDefaultCurrencyId());
                    Buff.setOptionalCustContactListTenantId(updatedBuff.getOptionalCustContactListTenantId());
                    Buff.setOptionalCustContactListId(updatedBuff.getOptionalCustContactListId());
                    Buff.setOptionalEmpContactListTenantId(updatedBuff.getOptionalEmpContactListTenantId());
                    Buff.setOptionalEmpContactListId(updatedBuff.getOptionalEmpContactListId());
                    Buff.setOptionalVendContactListTenantId(updatedBuff.getOptionalVendContactListTenantId());
                    Buff.setOptionalVendContactListId(updatedBuff.getOptionalVendContactListId());
                    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_acct_cfg() 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_acct_cfg() 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.cfacc.v2_0.CFAccOracle.CFAccOracleAccountEntryTable.java

public CFAccAccountEntryBuff[] readBuffByDrCcyIdx(CFAccAuthorization Authorization, Short DebitCurrencyId) {
    final String S_ProcName = "readBuffByDrCcyIdx";
    ResultSet resultSet = null;// w  w w .  j  a va2  s .  c om
    Connection cnx = schema.getCnx();
    CallableStatement stmtReadBuffByDrCcyIdx = null;
    List<CFAccAccountEntryBuff> buffList = new LinkedList<CFAccAccountEntryBuff>();
    try {
        stmtReadBuffByDrCcyIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".rd_ac_entrybydrccyidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtReadBuffByDrCcyIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadBuffByDrCcyIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByDrCcyIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByDrCcyIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByDrCcyIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByDrCcyIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (DebitCurrencyId != null) {
            stmtReadBuffByDrCcyIdx.setShort(argIdx++, DebitCurrencyId.shortValue());
        } else {
            stmtReadBuffByDrCcyIdx.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        stmtReadBuffByDrCcyIdx.execute();
        resultSet = (ResultSet) stmtReadBuffByDrCcyIdx.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    CFAccAccountEntryBuff buff = unpackAccountEntryResultSetToBuff(resultSet);
                    buffList.add(buff);
                }
                try {
                    resultSet.close();
                } catch (SQLException e) {
                }
                resultSet = null;
            } catch (SQLException e) {
            }
        }
        int idx = 0;
        CFAccAccountEntryBuff[] retBuff = new CFAccAccountEntryBuff[buffList.size()];
        Iterator<CFAccAccountEntryBuff> 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;
        }
        if (stmtReadBuffByDrCcyIdx != null) {
            try {
                stmtReadBuffByDrCcyIdx.close();
            } catch (SQLException e) {
            }
            stmtReadBuffByDrCcyIdx = null;
        }
    }
}

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

public CFAccAccountEntryBuff[] readBuffByBalCcyIdx(CFAccAuthorization Authorization, short BalanceCurrencyId) {
    final String S_ProcName = "readBuffByBalCcyIdx";
    ResultSet resultSet = null;/* w w w.  j  a v a  2 s.c  o m*/
    Connection cnx = schema.getCnx();
    CallableStatement stmtReadBuffByBalCcyIdx = null;
    List<CFAccAccountEntryBuff> buffList = new LinkedList<CFAccAccountEntryBuff>();
    try {
        stmtReadBuffByBalCcyIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".rd_ac_entrybybalccyidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtReadBuffByBalCcyIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadBuffByBalCcyIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByBalCcyIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByBalCcyIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByBalCcyIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByBalCcyIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByBalCcyIdx.setShort(argIdx++, BalanceCurrencyId);
        stmtReadBuffByBalCcyIdx.execute();
        resultSet = (ResultSet) stmtReadBuffByBalCcyIdx.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    CFAccAccountEntryBuff buff = unpackAccountEntryResultSetToBuff(resultSet);
                    buffList.add(buff);
                }
                try {
                    resultSet.close();
                } catch (SQLException e) {
                }
                resultSet = null;
            } catch (SQLException e) {
            }
        }
        int idx = 0;
        CFAccAccountEntryBuff[] retBuff = new CFAccAccountEntryBuff[buffList.size()];
        Iterator<CFAccAccountEntryBuff> 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;
        }
        if (stmtReadBuffByBalCcyIdx != null) {
            try {
                stmtReadBuffByBalCcyIdx.close();
            } catch (SQLException e) {
            }
            stmtReadBuffByBalCcyIdx = null;
        }
    }
}

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

public CFAccAccountEntryBuff[] readBuffByCrCcyIdx(CFAccAuthorization Authorization, Short CreditCurrencyId) {
    final String S_ProcName = "readBuffByCrCcyIdx";
    ResultSet resultSet = null;/* w w  w. j av  a 2 s .c  o  m*/
    Connection cnx = schema.getCnx();
    CallableStatement stmtReadBuffByCrCcyIdx = null;
    List<CFAccAccountEntryBuff> buffList = new LinkedList<CFAccAccountEntryBuff>();
    try {
        stmtReadBuffByCrCcyIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".rd_ac_entrybycrccyidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtReadBuffByCrCcyIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadBuffByCrCcyIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCrCcyIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByCrCcyIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByCrCcyIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCrCcyIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (CreditCurrencyId != null) {
            stmtReadBuffByCrCcyIdx.setShort(argIdx++, CreditCurrencyId.shortValue());
        } else {
            stmtReadBuffByCrCcyIdx.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        stmtReadBuffByCrCcyIdx.execute();
        resultSet = (ResultSet) stmtReadBuffByCrCcyIdx.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    CFAccAccountEntryBuff buff = unpackAccountEntryResultSetToBuff(resultSet);
                    buffList.add(buff);
                }
                try {
                    resultSet.close();
                } catch (SQLException e) {
                }
                resultSet = null;
            } catch (SQLException e) {
            }
        }
        int idx = 0;
        CFAccAccountEntryBuff[] retBuff = new CFAccAccountEntryBuff[buffList.size()];
        Iterator<CFAccAccountEntryBuff> 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;
        }
        if (stmtReadBuffByCrCcyIdx != null) {
            try {
                stmtReadBuffByCrCcyIdx.close();
            } catch (SQLException e) {
            }
            stmtReadBuffByCrCcyIdx = null;
        }
    }
}

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

public CFAccAccountEntryBuff[] readBuffByCvtCcyIdx(CFAccAuthorization Authorization,
        short ConvertedCurrencyId) {
    final String S_ProcName = "readBuffByCvtCcyIdx";
    ResultSet resultSet = null;//from w  w  w. ja  v  a  2  s.  c o m
    Connection cnx = schema.getCnx();
    CallableStatement stmtReadBuffByCvtCcyIdx = null;
    List<CFAccAccountEntryBuff> buffList = new LinkedList<CFAccAccountEntryBuff>();
    try {
        stmtReadBuffByCvtCcyIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".rd_ac_entrybycvtccyidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtReadBuffByCvtCcyIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadBuffByCvtCcyIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCvtCcyIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByCvtCcyIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByCvtCcyIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCvtCcyIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByCvtCcyIdx.setShort(argIdx++, ConvertedCurrencyId);
        stmtReadBuffByCvtCcyIdx.execute();
        resultSet = (ResultSet) stmtReadBuffByCvtCcyIdx.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    CFAccAccountEntryBuff buff = unpackAccountEntryResultSetToBuff(resultSet);
                    buffList.add(buff);
                }
                try {
                    resultSet.close();
                } catch (SQLException e) {
                }
                resultSet = null;
            } catch (SQLException e) {
            }
        }
        int idx = 0;
        CFAccAccountEntryBuff[] retBuff = new CFAccAccountEntryBuff[buffList.size()];
        Iterator<CFAccAccountEntryBuff> 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;
        }
        if (stmtReadBuffByCvtCcyIdx != null) {
            try {
                stmtReadBuffByCvtCcyIdx.close();
            } catch (SQLException e) {
            }
            stmtReadBuffByCvtCcyIdx = null;
        }
    }
}

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

public void createAddress(CFAccAuthorization Authorization, CFAccAddressBuff Buff) {
    final String S_ProcName = "createAddress";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*from w w w.  j a va2  s  .com*/
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        long TenantId = Buff.getRequiredTenantId();
        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();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".crt_address( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", "
                + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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++, "ADR");
        stmtCreateByPKey.setLong(argIdx++, TenantId);
        stmtCreateByPKey.setLong(argIdx++, ContactId);
        stmtCreateByPKey.setString(argIdx++, Description);
        if (AddrLine1 != null) {
            stmtCreateByPKey.setString(argIdx++, AddrLine1);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (AddrLine2 != null) {
            stmtCreateByPKey.setString(argIdx++, AddrLine2);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (City != null) {
            stmtCreateByPKey.setString(argIdx++, City);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (State != null) {
            stmtCreateByPKey.setString(argIdx++, State);
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (CountryId != null) {
            stmtCreateByPKey.setShort(argIdx++, CountryId.shortValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        if (Zip != null) {
            stmtCreateByPKey.setString(argIdx++, Zip);
        } 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_address() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFAccAddressBuff createdBuff = 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.setRequiredTenantId(createdBuff.getRequiredTenantId());
                Buff.setRequiredAddressId(createdBuff.getRequiredAddressId());
                Buff.setRequiredContactId(createdBuff.getRequiredContactId());
                Buff.setRequiredDescription(createdBuff.getRequiredDescription());
                Buff.setOptionalAddrLine1(createdBuff.getOptionalAddrLine1());
                Buff.setOptionalAddrLine2(createdBuff.getOptionalAddrLine2());
                Buff.setOptionalCity(createdBuff.getOptionalCity());
                Buff.setOptionalState(createdBuff.getOptionalState());
                Buff.setOptionalCountryId(createdBuff.getOptionalCountryId());
                Buff.setOptionalZip(createdBuff.getOptionalZip());
                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_address() 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;
        }
    }
}