Example usage for java.lang Short shortValue

List of usage examples for java.lang Short shortValue

Introduction

In this page you can find the example usage for java.lang Short shortValue.

Prototype

@HotSpotIntrinsicCandidate
public short shortValue() 

Source Link

Document

Returns the value of this Short as a short .

Usage

From source file:net.sourceforge.msscodefactory.cfcrm.v2_1.CFCrmMSSql.CFCrmMSSqlISOLanguageTable.java

public CFCrmISOLanguageBuff[] readBuffByCountryIdx(CFCrmAuthorization Authorization, Short ISOCountryId) {
    final String S_ProcName = "readBuffByCountryIdx";
    ResultSet resultSet = null;//ww  w .  j  a  v  a 2s.com
    try {
        Connection cnx = schema.getCnx();
        String sql = "{ call sp_read_iso_lang_by_countryidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) }";
        if (stmtReadBuffByCountryIdx == null) {
            stmtReadBuffByCountryIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (ISOCountryId != null) {
            stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        resultSet = stmtReadBuffByCountryIdx.executeQuery();
        List<CFCrmISOLanguageBuff> buffList = new LinkedList<CFCrmISOLanguageBuff>();
        if (resultSet != null) {
            while (resultSet.next()) {
                CFCrmISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet);
                buffList.add(buff);
            }
        }
        int idx = 0;
        CFCrmISOLanguageBuff[] retBuff = new CFCrmISOLanguageBuff[buffList.size()];
        Iterator<CFCrmISOLanguageBuff> 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;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfinternet.v2_1.CFInternetMSSql.CFInternetMSSqlISOLanguageTable.java

public CFInternetISOLanguageBuff[] readBuffByCountryIdx(CFInternetAuthorization Authorization,
        Short ISOCountryId) {
    final String S_ProcName = "readBuffByCountryIdx";
    ResultSet resultSet = null;//w ww . j a va2 s.co  m
    try {
        Connection cnx = schema.getCnx();
        String sql = "{ call sp_read_iso_lang_by_countryidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) }";
        if (stmtReadBuffByCountryIdx == null) {
            stmtReadBuffByCountryIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (ISOCountryId != null) {
            stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        resultSet = stmtReadBuffByCountryIdx.executeQuery();
        List<CFInternetISOLanguageBuff> buffList = new LinkedList<CFInternetISOLanguageBuff>();
        if (resultSet != null) {
            while (resultSet.next()) {
                CFInternetISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet);
                buffList.add(buff);
            }
        }
        int idx = 0;
        CFInternetISOLanguageBuff[] retBuff = new CFInternetISOLanguageBuff[buffList.size()];
        Iterator<CFInternetISOLanguageBuff> 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;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskMSSql.CFAsteriskMSSqlISOLanguageTable.java

public CFSecurityISOLanguageBuff[] readBuffByCountryIdx(CFSecurityAuthorization Authorization,
        Short ISOCountryId) {
    final String S_ProcName = "readBuffByCountryIdx";
    ResultSet resultSet = null;/*from   w  w  w  .ja v a  2 s . c  om*/
    try {
        Connection cnx = schema.getCnx();
        String sql = "{ call sp_read_iso_lang_by_countryidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) }";
        if (stmtReadBuffByCountryIdx == null) {
            stmtReadBuffByCountryIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (ISOCountryId != null) {
            stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        resultSet = stmtReadBuffByCountryIdx.executeQuery();
        List<CFSecurityISOLanguageBuff> buffList = new LinkedList<CFSecurityISOLanguageBuff>();
        if (resultSet != null) {
            while (resultSet.next()) {
                CFSecurityISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet);
                buffList.add(buff);
            }
        }
        int idx = 0;
        CFSecurityISOLanguageBuff[] retBuff = new CFSecurityISOLanguageBuff[buffList.size()];
        Iterator<CFSecurityISOLanguageBuff> 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;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccMSSql.CFAccMSSqlISOLanguageTable.java

public CFAccISOLanguageBuff[] readBuffByCountryIdx(CFAccAuthorization Authorization, Short ISOCountryId) {
    final String S_ProcName = "readBuffByCountryIdx";
    ResultSet resultSet = null;//from w w w . j a va 2 s  . c o  m
    try {
        Connection cnx = schema.getCnx();
        String sql = "{ call sp_read_iso_lang_by_countryidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) }";
        if (stmtReadBuffByCountryIdx == null) {
            stmtReadBuffByCountryIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (ISOCountryId != null) {
            stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        resultSet = stmtReadBuffByCountryIdx.executeQuery();
        List<CFAccISOLanguageBuff> buffList = new LinkedList<CFAccISOLanguageBuff>();
        if (resultSet != null) {
            while (resultSet.next()) {
                CFAccISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet);
                buffList.add(buff);
            }
        }
        int idx = 0;
        CFAccISOLanguageBuff[] retBuff = new CFAccISOLanguageBuff[buffList.size()];
        Iterator<CFAccISOLanguageBuff> 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;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstMSSql.CFAstMSSqlISOLanguageTable.java

public CFAstISOLanguageBuff[] readBuffByCountryIdx(CFAstAuthorization Authorization, Short ISOCountryId) {
    final String S_ProcName = "readBuffByCountryIdx";
    ResultSet resultSet = null;//from   w  w  w . ja va  2  s. c om
    try {
        Connection cnx = schema.getCnx();
        String sql = "{ call sp_read_iso_lang_by_countryidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) }";
        if (stmtReadBuffByCountryIdx == null) {
            stmtReadBuffByCountryIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (ISOCountryId != null) {
            stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        resultSet = stmtReadBuffByCountryIdx.executeQuery();
        List<CFAstISOLanguageBuff> buffList = new LinkedList<CFAstISOLanguageBuff>();
        if (resultSet != null) {
            while (resultSet.next()) {
                CFAstISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet);
                buffList.add(buff);
            }
        }
        int idx = 0;
        CFAstISOLanguageBuff[] retBuff = new CFAstISOLanguageBuff[buffList.size()];
        Iterator<CFAstISOLanguageBuff> 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;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfinternet.v2_1.CFInternetSybase.CFInternetSybaseISOLanguageTable.java

public CFInternetISOLanguageBuff[] readBuffByCountryIdx(CFInternetAuthorization Authorization,
        Short ISOCountryId) {
    final String S_ProcName = "readBuffByCountryIdx";
    ResultSet resultSet = null;/*from ww  w .j av  a  2  s.c o  m*/
    try {
        Connection cnx = schema.getCnx();
        String sql = "exec sp_read_iso_lang_by_countryidx ?, ?, ?, ?, ?" + ", " + "?";
        if (stmtReadBuffByCountryIdx == null) {
            stmtReadBuffByCountryIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (ISOCountryId != null) {
            stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        resultSet = stmtReadBuffByCountryIdx.executeQuery();
        List<CFInternetISOLanguageBuff> buffList = new LinkedList<CFInternetISOLanguageBuff>();
        while (resultSet.next()) {
            CFInternetISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        int idx = 0;
        CFInternetISOLanguageBuff[] retBuff = new CFInternetISOLanguageBuff[buffList.size()];
        Iterator<CFInternetISOLanguageBuff> 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;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSybase.CFAsteriskSybaseISOLanguageTable.java

public CFSecurityISOLanguageBuff[] readBuffByCountryIdx(CFSecurityAuthorization Authorization,
        Short ISOCountryId) {
    final String S_ProcName = "readBuffByCountryIdx";
    ResultSet resultSet = null;//w  w  w . ja  v a2  s.co  m
    try {
        Connection cnx = schema.getCnx();
        String sql = "exec sp_read_iso_lang_by_countryidx ?, ?, ?, ?, ?" + ", " + "?";
        if (stmtReadBuffByCountryIdx == null) {
            stmtReadBuffByCountryIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (ISOCountryId != null) {
            stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        resultSet = stmtReadBuffByCountryIdx.executeQuery();
        List<CFSecurityISOLanguageBuff> buffList = new LinkedList<CFSecurityISOLanguageBuff>();
        while (resultSet.next()) {
            CFSecurityISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        int idx = 0;
        CFSecurityISOLanguageBuff[] retBuff = new CFSecurityISOLanguageBuff[buffList.size()];
        Iterator<CFSecurityISOLanguageBuff> 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;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstSybase.CFAstSybaseISOLanguageTable.java

public CFAstISOLanguageBuff[] readBuffByCountryIdx(CFAstAuthorization Authorization, Short ISOCountryId) {
    final String S_ProcName = "readBuffByCountryIdx";
    ResultSet resultSet = null;//w  ww . ja  v  a  2 s . c  o m
    try {
        Connection cnx = schema.getCnx();
        String sql = "exec sp_read_iso_lang_by_countryidx ?, ?, ?, ?, ?" + ", " + "?";
        if (stmtReadBuffByCountryIdx == null) {
            stmtReadBuffByCountryIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (ISOCountryId != null) {
            stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        resultSet = stmtReadBuffByCountryIdx.executeQuery();
        List<CFAstISOLanguageBuff> buffList = new LinkedList<CFAstISOLanguageBuff>();
        while (resultSet.next()) {
            CFAstISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        int idx = 0;
        CFAstISOLanguageBuff[] retBuff = new CFAstISOLanguageBuff[buffList.size()];
        Iterator<CFAstISOLanguageBuff> 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;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxMSSql.CFEnSyntaxMSSqlISOLanguageTable.java

public CFEnSyntaxISOLanguageBuff[] readBuffByCountryIdx(CFEnSyntaxAuthorization Authorization,
        Short ISOCountryId) {
    final String S_ProcName = "readBuffByCountryIdx";
    ResultSet resultSet = null;//from  w w  w  .ja  v  a2 s .c o  m
    try {
        Connection cnx = schema.getCnx();
        String sql = "{ call sp_read_iso_lang_by_countryidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) }";
        if (stmtReadBuffByCountryIdx == null) {
            stmtReadBuffByCountryIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (ISOCountryId != null) {
            stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        resultSet = stmtReadBuffByCountryIdx.executeQuery();
        List<CFEnSyntaxISOLanguageBuff> buffList = new LinkedList<CFEnSyntaxISOLanguageBuff>();
        if (resultSet != null) {
            while (resultSet.next()) {
                CFEnSyntaxISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet);
                buffList.add(buff);
            }
        }
        int idx = 0;
        CFEnSyntaxISOLanguageBuff[] retBuff = new CFEnSyntaxISOLanguageBuff[buffList.size()];
        Iterator<CFEnSyntaxISOLanguageBuff> 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;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfinternet.v2_1.CFInternetPgSql.CFInternetPgSqlISOLanguageTable.java

public CFInternetISOLanguageBuff[] readBuffByCountryIdx(CFInternetAuthorization Authorization,
        Short ISOCountryId) {
    final String S_ProcName = "readBuffByCountryIdx";
    ResultSet resultSet = null;/*from  w ww .  j  a v  a 2s. c om*/
    try {
        Connection cnx = schema.getCnx();
        String sql = "SELECT * FROM " + schema.getLowerDbSchemaName()
                + ".sp_read_iso_lang_by_countryidx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
        if (stmtReadBuffByCountryIdx == null) {
            stmtReadBuffByCountryIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCountryIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (ISOCountryId != null) {
            stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue());
        } else {
            stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        resultSet = stmtReadBuffByCountryIdx.executeQuery();
        List<CFInternetISOLanguageBuff> buffList = new LinkedList<CFInternetISOLanguageBuff>();
        while (resultSet.next()) {
            CFInternetISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        int idx = 0;
        CFInternetISOLanguageBuff[] retBuff = new CFInternetISOLanguageBuff[buffList.size()];
        Iterator<CFInternetISOLanguageBuff> 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;
        }
    }
}