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.cffreeswitch.v2_1.CFFswOracle.CFFswOracleISOCountryCurrencyTable.java

public void createISOCountryCurrency(CFFswAuthorization Authorization, CFFswISOCountryCurrencyBuff Buff) {
    final String S_ProcName = "createISOCountryCurrency";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from   w  w  w .j av a2  s . c om
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        short ISOCountryId = Buff.getRequiredISOCountryId();
        short ISOCurrencyId = Buff.getRequiredISOCurrencyId();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".crt_iso_cntryccy( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); 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++, "ICCY");
        stmtCreateByPKey.setShort(argIdx++, ISOCountryId);
        stmtCreateByPKey.setShort(argIdx++, ISOCurrencyId);
        stmtCreateByPKey.execute();
        resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
        if (resultSet == null) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_iso_cntryccy() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFFswISOCountryCurrencyBuff createdBuff = unpackISOCountryCurrencyResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                Buff.setRequiredISOCountryId(createdBuff.getRequiredISOCountryId());
                Buff.setRequiredISOCurrencyId(createdBuff.getRequiredISOCurrencyId());
                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_cntryccy() 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.CFFswOracleISOCountryLanguageTable.java

public void createISOCountryLanguage(CFFswAuthorization Authorization, CFFswISOCountryLanguageBuff Buff) {
    final String S_ProcName = "createISOCountryLanguage";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }// w w  w . j  av  a 2  s  .  c  om
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        short ISOCountryId = Buff.getRequiredISOCountryId();
        short ISOLanguageId = Buff.getRequiredISOLanguageId();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".crt_iso_cntrylng( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); 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++, "ISCL");
        stmtCreateByPKey.setShort(argIdx++, ISOCountryId);
        stmtCreateByPKey.setShort(argIdx++, ISOLanguageId);
        stmtCreateByPKey.execute();
        resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
        if (resultSet == null) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_iso_cntrylng() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFFswISOCountryLanguageBuff createdBuff = unpackISOCountryLanguageResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                Buff.setRequiredISOCountryId(createdBuff.getRequiredISOCountryId());
                Buff.setRequiredISOLanguageId(createdBuff.getRequiredISOLanguageId());
                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_cntrylng() 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.CFEnSyntaxOracleISOCountryCurrencyTable.java

public void createISOCountryCurrency(CFEnSyntaxAuthorization Authorization,
        CFEnSyntaxISOCountryCurrencyBuff Buff) {
    final String S_ProcName = "createISOCountryCurrency";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/* w w w.  ja va2  s. com*/
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        short ISOCountryId = Buff.getRequiredISOCountryId();
        short ISOCurrencyId = Buff.getRequiredISOCurrencyId();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".crt_iso_cntryccy( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); 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++, "ICCY");
        stmtCreateByPKey.setShort(argIdx++, ISOCountryId);
        stmtCreateByPKey.setShort(argIdx++, ISOCurrencyId);
        stmtCreateByPKey.execute();
        resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
        if (resultSet == null) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_iso_cntryccy() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFEnSyntaxISOCountryCurrencyBuff createdBuff = unpackISOCountryCurrencyResultSetToBuff(
                        resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                Buff.setRequiredISOCountryId(createdBuff.getRequiredISOCountryId());
                Buff.setRequiredISOCurrencyId(createdBuff.getRequiredISOCurrencyId());
                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_cntryccy() 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.CFEnSyntaxOracleISOCountryLanguageTable.java

public void createISOCountryLanguage(CFEnSyntaxAuthorization Authorization,
        CFEnSyntaxISOCountryLanguageBuff Buff) {
    final String S_ProcName = "createISOCountryLanguage";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*from www .j a va  2 s. c  o m*/
    ResultSet resultSet = null;
    CallableStatement stmtCreateByPKey = null;
    try {
        short ISOCountryId = Buff.getRequiredISOCountryId();
        short ISOLanguageId = Buff.getRequiredISOLanguageId();
        Connection cnx = schema.getCnx();
        stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".crt_iso_cntrylng( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); 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++, "ISCL");
        stmtCreateByPKey.setShort(argIdx++, ISOCountryId);
        stmtCreateByPKey.setShort(argIdx++, ISOLanguageId);
        stmtCreateByPKey.execute();
        resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
        if (resultSet == null) {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "crt_iso_cntrylng() did not return a result set");
        }
        try {
            if (resultSet.next()) {
                CFEnSyntaxISOCountryLanguageBuff createdBuff = unpackISOCountryLanguageResultSetToBuff(
                        resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                Buff.setRequiredISOCountryId(createdBuff.getRequiredISOCountryId());
                Buff.setRequiredISOLanguageId(createdBuff.getRequiredISOLanguageId());
                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_cntrylng() 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.CFAccOracleISOTimezoneTable.java

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

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleISOTimezoneTable.java

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

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstOracle.CFAstOracleISOTimezoneTable.java

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

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

public CFFswISOTimezoneBuff[] readBuffByOffsetIdx(CFFswAuthorization Authorization, short TZHourOffset,
        short TZMinOffset) {
    final String S_ProcName = "readBuffByOffsetIdx";
    ResultSet resultSet = null;/*from w ww  . ja  v a  2 s. co m*/
    Connection cnx = schema.getCnx();
    CallableStatement stmtReadBuffByOffsetIdx = null;
    List<CFFswISOTimezoneBuff> buffList = new LinkedList<CFFswISOTimezoneBuff>();
    try {
        stmtReadBuffByOffsetIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".rd_isotzbyoffsetidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtReadBuffByOffsetIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadBuffByOffsetIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByOffsetIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByOffsetIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByOffsetIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByOffsetIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByOffsetIdx.setShort(argIdx++, TZHourOffset);
        stmtReadBuffByOffsetIdx.setShort(argIdx++, TZMinOffset);
        stmtReadBuffByOffsetIdx.execute();
        resultSet = (ResultSet) stmtReadBuffByOffsetIdx.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    CFFswISOTimezoneBuff buff = unpackISOTimezoneResultSetToBuff(resultSet);
                    buffList.add(buff);
                }
                try {
                    resultSet.close();
                } catch (SQLException e) {
                }
                resultSet = null;
            } catch (SQLException e) {
            }
        }
        int idx = 0;
        CFFswISOTimezoneBuff[] retBuff = new CFFswISOTimezoneBuff[buffList.size()];
        Iterator<CFFswISOTimezoneBuff> 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 (stmtReadBuffByOffsetIdx != null) {
            try {
                stmtReadBuffByOffsetIdx.close();
            } catch (SQLException e) {
            }
            stmtReadBuffByOffsetIdx = null;
        }
    }
}

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

public CFSecurityISOTimezoneBuff[] readBuffByOffsetIdx(CFSecurityAuthorization Authorization,
        short TZHourOffset, short TZMinOffset) {
    final String S_ProcName = "readBuffByOffsetIdx";
    ResultSet resultSet = null;/*from   w  ww .  j ava  2  s .c o m*/
    Connection cnx = schema.getCnx();
    CallableStatement stmtReadBuffByOffsetIdx = null;
    List<CFSecurityISOTimezoneBuff> buffList = new LinkedList<CFSecurityISOTimezoneBuff>();
    try {
        stmtReadBuffByOffsetIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".rd_isotzbyoffsetidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtReadBuffByOffsetIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadBuffByOffsetIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByOffsetIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByOffsetIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByOffsetIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByOffsetIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByOffsetIdx.setShort(argIdx++, TZHourOffset);
        stmtReadBuffByOffsetIdx.setShort(argIdx++, TZMinOffset);
        stmtReadBuffByOffsetIdx.execute();
        resultSet = (ResultSet) stmtReadBuffByOffsetIdx.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    CFSecurityISOTimezoneBuff buff = unpackISOTimezoneResultSetToBuff(resultSet);
                    buffList.add(buff);
                }
                try {
                    resultSet.close();
                } catch (SQLException e) {
                }
                resultSet = null;
            } catch (SQLException e) {
            }
        }
        int idx = 0;
        CFSecurityISOTimezoneBuff[] retBuff = new CFSecurityISOTimezoneBuff[buffList.size()];
        Iterator<CFSecurityISOTimezoneBuff> 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 (stmtReadBuffByOffsetIdx != null) {
            try {
                stmtReadBuffByOffsetIdx.close();
            } catch (SQLException e) {
            }
            stmtReadBuffByOffsetIdx = null;
        }
    }
}

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

public void updateISOCountry(CFSecurityAuthorization Authorization, CFSecurityISOCountryBuff Buff) {
    final String S_ProcName = "updateISOCountry";
    ResultSet resultSet = null;// w  w  w.  jav  a  2s .  c  om
    Connection cnx = schema.getCnx();
    CallableStatement stmtUpdateByPKey = null;
    List<CFSecurityISOCountryBuff> buffList = new LinkedList<CFSecurityISOCountryBuff>();
    try {
        short Id = Buff.getRequiredId();
        String ISOCode = Buff.getRequiredISOCode();
        String Name = Buff.getRequiredName();
        int Revision = Buff.getRequiredRevision();
        stmtUpdateByPKey = cnx
                .prepareCall("begin " + schema.getLowerDbSchemaName() + ".upd_iso_cntry( ?, ?, ?, ?, ?, ?, ?"
                        + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); 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++, "ISOC");
        stmtUpdateByPKey.setShort(argIdx++, Id);
        stmtUpdateByPKey.setString(argIdx++, ISOCode);
        stmtUpdateByPKey.setString(argIdx++, Name);
        stmtUpdateByPKey.setInt(argIdx++, Revision);
        stmtUpdateByPKey.execute();
        resultSet = (ResultSet) stmtUpdateByPKey.getObject(1);
        if (resultSet != null) {
            try {
                if (resultSet.next()) {
                    CFSecurityISOCountryBuff updatedBuff = unpackISOCountryResultSetToBuff(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.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_cntry() 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_cntry() 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;
        }
    }
}