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.cfasterisk.v2_4.CFAsteriskOracle.CFAsteriskOracleISOLanguageTable.java

public void createISOLanguage(CFSecurityAuthorization Authorization, CFSecurityISOLanguageBuff Buff) {
    final String S_ProcName = "createISOLanguage";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//  w  ww .  ja  v  a 2 s .co  m
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        short Id = Buff.getRequiredId();
        String ISOCode = Buff.getRequiredISOCode();
        String BaseLanguageCode = Buff.getRequiredBaseLanguageCode();
        Short ISOCountryId = Buff.getOptionalISOCountryId();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx
                .prepareCall("begin " + schema.getLowerDbSchemaName() + ".crt_iso_lang( ?, ?, ?, ?, ?, ?, ?"
                        + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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++, "ISLN");
        stmtCreateByPKey.setShort(argIdx++, Id);
        stmtCreateByPKey.setString(argIdx++, ISOCode);
        stmtCreateByPKey.setString(argIdx++, BaseLanguageCode);
        if (ISOCountryId != null) {
            stmtCreateByPKey.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        stmtCreateByPKey.execute();
        resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
        if (resultSet == null) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_iso_lang() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFSecurityISOLanguageBuff createdBuff = unpackISOLanguageResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                Buff.setRequiredId(createdBuff.getRequiredId());
                Buff.setRequiredISOCode(createdBuff.getRequiredISOCode());
                Buff.setRequiredBaseLanguageCode(createdBuff.getRequiredBaseLanguageCode());
                Buff.setOptionalISOCountryId(createdBuff.getOptionalISOCountryId());
                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_iso_lang() 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.CFAccOracleISOLanguageTable.java

public void createISOLanguage(CFAccAuthorization Authorization, CFAccISOLanguageBuff Buff) {
    final String S_ProcName = "createISOLanguage";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*from   www.  j  a  v  a 2s.c o m*/
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        short Id = Buff.getRequiredId();
        String ISOCode = Buff.getRequiredISOCode();
        String BaseLanguageCode = Buff.getRequiredBaseLanguageCode();
        Short ISOCountryId = Buff.getOptionalISOCountryId();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx
                .prepareCall("begin " + schema.getLowerSchemaDbName() + ".crt_iso_lang( ?, ?, ?, ?, ?, ?, ?"
                        + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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++, "ISLN");
        stmtCreateByPKey.setShort(argIdx++, Id);
        stmtCreateByPKey.setString(argIdx++, ISOCode);
        stmtCreateByPKey.setString(argIdx++, BaseLanguageCode);
        if (ISOCountryId != null) {
            stmtCreateByPKey.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        stmtCreateByPKey.execute();
        resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
        if (resultSet == null) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_iso_lang() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFAccISOLanguageBuff createdBuff = unpackISOLanguageResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                Buff.setRequiredId(createdBuff.getRequiredId());
                Buff.setRequiredISOCode(createdBuff.getRequiredISOCode());
                Buff.setRequiredBaseLanguageCode(createdBuff.getRequiredBaseLanguageCode());
                Buff.setOptionalISOCountryId(createdBuff.getOptionalISOCountryId());
                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_iso_lang() 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.cfasterisk.v2_0.CFAstOracle.CFAstOracleISOLanguageTable.java

public void createISOLanguage(CFAstAuthorization Authorization, CFAstISOLanguageBuff Buff) {
    final String S_ProcName = "createISOLanguage";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/* w  w  w.j  av  a 2  s  .  co  m*/
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        short Id = Buff.getRequiredId();
        String ISOCode = Buff.getRequiredISOCode();
        String BaseLanguageCode = Buff.getRequiredBaseLanguageCode();
        Short ISOCountryId = Buff.getOptionalISOCountryId();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx
                .prepareCall("begin " + schema.getLowerSchemaDbName() + ".crt_iso_lang( ?, ?, ?, ?, ?, ?, ?"
                        + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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++, "ISLN");
        stmtCreateByPKey.setShort(argIdx++, Id);
        stmtCreateByPKey.setString(argIdx++, ISOCode);
        stmtCreateByPKey.setString(argIdx++, BaseLanguageCode);
        if (ISOCountryId != null) {
            stmtCreateByPKey.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        stmtCreateByPKey.execute();
        resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
        if (resultSet == null) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_iso_lang() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFAstISOLanguageBuff createdBuff = unpackISOLanguageResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                Buff.setRequiredId(createdBuff.getRequiredId());
                Buff.setRequiredISOCode(createdBuff.getRequiredISOCode());
                Buff.setRequiredBaseLanguageCode(createdBuff.getRequiredBaseLanguageCode());
                Buff.setOptionalISOCountryId(createdBuff.getOptionalISOCountryId());
                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_iso_lang() 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.cfasterisk.v2_1.CFAstOracle.CFAstOracleISOLanguageTable.java

public void createISOLanguage(CFAstAuthorization Authorization, CFAstISOLanguageBuff Buff) {
    final String S_ProcName = "createISOLanguage";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*from w  w w  . j a va2  s . c  o m*/
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        short Id = Buff.getRequiredId();
        String ISOCode = Buff.getRequiredISOCode();
        String BaseLanguageCode = Buff.getRequiredBaseLanguageCode();
        Short ISOCountryId = Buff.getOptionalISOCountryId();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx
                .prepareCall("begin " + schema.getLowerDbSchemaName() + ".crt_iso_lang( ?, ?, ?, ?, ?, ?, ?"
                        + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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++, "ISLN");
        stmtCreateByPKey.setShort(argIdx++, Id);
        stmtCreateByPKey.setString(argIdx++, ISOCode);
        stmtCreateByPKey.setString(argIdx++, BaseLanguageCode);
        if (ISOCountryId != null) {
            stmtCreateByPKey.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        stmtCreateByPKey.execute();
        resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
        if (resultSet == null) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_iso_lang() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFAstISOLanguageBuff createdBuff = unpackISOLanguageResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                Buff.setRequiredId(createdBuff.getRequiredId());
                Buff.setRequiredISOCode(createdBuff.getRequiredISOCode());
                Buff.setRequiredBaseLanguageCode(createdBuff.getRequiredBaseLanguageCode());
                Buff.setOptionalISOCountryId(createdBuff.getOptionalISOCountryId());
                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_iso_lang() 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.CFFswOracleISOLanguageTable.java

public void createISOLanguage(CFFswAuthorization Authorization, CFFswISOLanguageBuff Buff) {
    final String S_ProcName = "createISOLanguage";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from   w w  w.  j  a  v a 2s . co  m
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        short Id = Buff.getRequiredId();
        String ISOCode = Buff.getRequiredISOCode();
        String BaseLanguageCode = Buff.getRequiredBaseLanguageCode();
        Short ISOCountryId = Buff.getOptionalISOCountryId();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx
                .prepareCall("begin " + schema.getLowerDbSchemaName() + ".crt_iso_lang( ?, ?, ?, ?, ?, ?, ?"
                        + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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++, "ISLN");
        stmtCreateByPKey.setShort(argIdx++, Id);
        stmtCreateByPKey.setString(argIdx++, ISOCode);
        stmtCreateByPKey.setString(argIdx++, BaseLanguageCode);
        if (ISOCountryId != null) {
            stmtCreateByPKey.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        stmtCreateByPKey.execute();
        resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
        if (resultSet == null) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_iso_lang() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFFswISOLanguageBuff createdBuff = unpackISOLanguageResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                Buff.setRequiredId(createdBuff.getRequiredId());
                Buff.setRequiredISOCode(createdBuff.getRequiredISOCode());
                Buff.setRequiredBaseLanguageCode(createdBuff.getRequiredBaseLanguageCode());
                Buff.setOptionalISOCountryId(createdBuff.getOptionalISOCountryId());
                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_iso_lang() 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.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleISOLanguageTable.java

public void createISOLanguage(CFEnSyntaxAuthorization Authorization, CFEnSyntaxISOLanguageBuff Buff) {
    final String S_ProcName = "createISOLanguage";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from   w ww  .j  a va2s  . c  o m
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        short Id = Buff.getRequiredId();
        String ISOCode = Buff.getRequiredISOCode();
        String BaseLanguageCode = Buff.getRequiredBaseLanguageCode();
        Short ISOCountryId = Buff.getOptionalISOCountryId();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx
                .prepareCall("begin " + schema.getLowerDbSchemaName() + ".crt_iso_lang( ?, ?, ?, ?, ?, ?, ?"
                        + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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++, "ISLN");
        stmtCreateByPKey.setShort(argIdx++, Id);
        stmtCreateByPKey.setString(argIdx++, ISOCode);
        stmtCreateByPKey.setString(argIdx++, BaseLanguageCode);
        if (ISOCountryId != null) {
            stmtCreateByPKey.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtCreateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        stmtCreateByPKey.execute();
        resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
        if (resultSet == null) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_iso_lang() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFEnSyntaxISOLanguageBuff createdBuff = unpackISOLanguageResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                Buff.setRequiredId(createdBuff.getRequiredId());
                Buff.setRequiredISOCode(createdBuff.getRequiredISOCode());
                Buff.setRequiredBaseLanguageCode(createdBuff.getRequiredBaseLanguageCode());
                Buff.setOptionalISOCountryId(createdBuff.getOptionalISOCountryId());
                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_iso_lang() 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.CFAccOracleContactURLTable.java

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

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskOracle.CFAsteriskOracleISOCurrencyTable.java

public void updateISOCurrency(CFSecurityAuthorization Authorization, CFSecurityISOCurrencyBuff Buff) {
    final String S_ProcName = "updateISOCurrency";
    ResultSet resultSet = null;//from w w  w  .  j a v  a2s .  c o m
    Connection cnx = schema.getCnx();
    CallableStatement stmtUpdateByPKey = null;
    List<CFSecurityISOCurrencyBuff> buffList = new LinkedList<CFSecurityISOCurrencyBuff>();
    try {
        short Id = Buff.getRequiredId();
        String ISOCode = Buff.getRequiredISOCode();
        String Name = Buff.getRequiredName();
        String UnitSymbol = Buff.getOptionalUnitSymbol();
        String FracSymbol = Buff.getOptionalFracSymbol();
        short Precis = Buff.getRequiredPrecis();
        int Revision = Buff.getRequiredRevision();
        stmtUpdateByPKey = cnx.prepareCall(
                "begin " + schema.getLowerDbSchemaName() + ".upd_iso_ccy( ?, ?, ?, ?, ?, ?, ?" + ", " + "?"
                        + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); 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++, "ISCY");
        stmtUpdateByPKey.setShort(argIdx++, Id);
        stmtUpdateByPKey.setString(argIdx++, ISOCode);
        stmtUpdateByPKey.setString(argIdx++, Name);
        if (UnitSymbol != null) {
            stmtUpdateByPKey.setString(argIdx++, UnitSymbol);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (FracSymbol != null) {
            stmtUpdateByPKey.setString(argIdx++, FracSymbol);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        stmtUpdateByPKey.setShort(argIdx++, Precis);
        stmtUpdateByPKey.setInt(argIdx++, Revision);
        stmtUpdateByPKey.execute();
        resultSet = (ResultSet) stmtUpdateByPKey.getObject(1);
        if (resultSet != null) {
            try {
                if (resultSet.next()) {
                    CFSecurityISOCurrencyBuff updatedBuff = unpackISOCurrencyResultSetToBuff(resultSet);
                    if (resultSet.next()) {
                        resultSet.last();
                        throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                                "Did not expect multi-record response, " + resultSet.getRow()
                                        + " rows selected");
                    }
                    Buff.setRequiredISOCode(updatedBuff.getRequiredISOCode());
                    Buff.setRequiredName(updatedBuff.getRequiredName());
                    Buff.setOptionalUnitSymbol(updatedBuff.getOptionalUnitSymbol());
                    Buff.setOptionalFracSymbol(updatedBuff.getOptionalFracSymbol());
                    Buff.setRequiredPrecis(updatedBuff.getRequiredPrecis());
                    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_iso_ccy() 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_iso_ccy() 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.CFAccOracleISOCurrencyTable.java

public void updateISOCurrency(CFAccAuthorization Authorization, CFAccISOCurrencyBuff Buff) {
    final String S_ProcName = "updateISOCurrency";
    ResultSet resultSet = null;//w  w  w  . j  a v  a  2 s  .c o m
    Connection cnx = schema.getCnx();
    CallableStatement stmtUpdateByPKey = null;
    List<CFAccISOCurrencyBuff> buffList = new LinkedList<CFAccISOCurrencyBuff>();
    try {
        short Id = Buff.getRequiredId();
        String ISOCode = Buff.getRequiredISOCode();
        String Name = Buff.getRequiredName();
        String UnitSymbol = Buff.getOptionalUnitSymbol();
        String FracSymbol = Buff.getOptionalFracSymbol();
        short Precis = Buff.getRequiredPrecis();
        int Revision = Buff.getRequiredRevision();
        stmtUpdateByPKey = cnx.prepareCall(
                "begin " + schema.getLowerSchemaDbName() + ".upd_iso_ccy( ?, ?, ?, ?, ?, ?, ?" + ", " + "?"
                        + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); 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++, "ISCY");
        stmtUpdateByPKey.setShort(argIdx++, Id);
        stmtUpdateByPKey.setString(argIdx++, ISOCode);
        stmtUpdateByPKey.setString(argIdx++, Name);
        if (UnitSymbol != null) {
            stmtUpdateByPKey.setString(argIdx++, UnitSymbol);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (FracSymbol != null) {
            stmtUpdateByPKey.setString(argIdx++, FracSymbol);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        stmtUpdateByPKey.setShort(argIdx++, Precis);
        stmtUpdateByPKey.setInt(argIdx++, Revision);
        stmtUpdateByPKey.execute();
        resultSet = (ResultSet) stmtUpdateByPKey.getObject(1);
        if (resultSet != null) {
            try {
                if (resultSet.next()) {
                    CFAccISOCurrencyBuff updatedBuff = unpackISOCurrencyResultSetToBuff(resultSet);
                    if (resultSet.next()) {
                        resultSet.last();
                        throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                                "Did not expect multi-record response, " + resultSet.getRow()
                                        + " rows selected");
                    }
                    Buff.setRequiredISOCode(updatedBuff.getRequiredISOCode());
                    Buff.setRequiredName(updatedBuff.getRequiredName());
                    Buff.setOptionalUnitSymbol(updatedBuff.getOptionalUnitSymbol());
                    Buff.setOptionalFracSymbol(updatedBuff.getOptionalFracSymbol());
                    Buff.setRequiredPrecis(updatedBuff.getRequiredPrecis());
                    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_iso_ccy() 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_iso_ccy() 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.cfasterisk.v2_0.CFAstOracle.CFAstOracleISOCurrencyTable.java

public void updateISOCurrency(CFAstAuthorization Authorization, CFAstISOCurrencyBuff Buff) {
    final String S_ProcName = "updateISOCurrency";
    ResultSet resultSet = null;//  www.j  a v  a  2 s . c  o  m
    Connection cnx = schema.getCnx();
    CallableStatement stmtUpdateByPKey = null;
    List<CFAstISOCurrencyBuff> buffList = new LinkedList<CFAstISOCurrencyBuff>();
    try {
        short Id = Buff.getRequiredId();
        String ISOCode = Buff.getRequiredISOCode();
        String Name = Buff.getRequiredName();
        String UnitSymbol = Buff.getOptionalUnitSymbol();
        String FracSymbol = Buff.getOptionalFracSymbol();
        short Precis = Buff.getRequiredPrecis();
        int Revision = Buff.getRequiredRevision();
        stmtUpdateByPKey = cnx.prepareCall(
                "begin " + schema.getLowerSchemaDbName() + ".upd_iso_ccy( ?, ?, ?, ?, ?, ?, ?" + ", " + "?"
                        + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); 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++, "ISCY");
        stmtUpdateByPKey.setShort(argIdx++, Id);
        stmtUpdateByPKey.setString(argIdx++, ISOCode);
        stmtUpdateByPKey.setString(argIdx++, Name);
        if (UnitSymbol != null) {
            stmtUpdateByPKey.setString(argIdx++, UnitSymbol);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (FracSymbol != null) {
            stmtUpdateByPKey.setString(argIdx++, FracSymbol);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        stmtUpdateByPKey.setShort(argIdx++, Precis);
        stmtUpdateByPKey.setInt(argIdx++, Revision);
        stmtUpdateByPKey.execute();
        resultSet = (ResultSet) stmtUpdateByPKey.getObject(1);
        if (resultSet != null) {
            try {
                if (resultSet.next()) {
                    CFAstISOCurrencyBuff updatedBuff = unpackISOCurrencyResultSetToBuff(resultSet);
                    if (resultSet.next()) {
                        resultSet.last();
                        throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                                "Did not expect multi-record response, " + resultSet.getRow()
                                        + " rows selected");
                    }
                    Buff.setRequiredISOCode(updatedBuff.getRequiredISOCode());
                    Buff.setRequiredName(updatedBuff.getRequiredName());
                    Buff.setOptionalUnitSymbol(updatedBuff.getOptionalUnitSymbol());
                    Buff.setOptionalFracSymbol(updatedBuff.getOptionalFracSymbol());
                    Buff.setRequiredPrecis(updatedBuff.getRequiredPrecis());
                    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_iso_ccy() 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_iso_ccy() 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;
        }
    }
}