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.cfasterisk.v2_1.CFAstMySql.CFAstMySqlISOLanguageTable.java

public CFAstISOLanguageBuff[] readBuffByCountryIdx(CFAstAuthorization Authorization, Short ISOCountryId) {
    final String S_ProcName = "readBuffByCountryIdx";
    ResultSet resultSet = null;//from   w ww.  jav a2 s  .c  o  m
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + 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);
        }
        try {
            resultSet = stmtReadBuffByCountryIdx.executeQuery();
        } catch (SQLException e) {
            if (e.getErrorCode() != 1329) {
                throw e;
            }
            resultSet = null;
        }
        List<CFAstISOLanguageBuff> buffList = new LinkedList<CFAstISOLanguageBuff>();
        while ((resultSet != null) && 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.cffreeswitch.v2_1.CFFswMySql.CFFswMySqlISOLanguageTable.java

public CFFswISOLanguageBuff[] readBuffByCountryIdx(CFFswAuthorization Authorization, Short ISOCountryId) {
    final String S_ProcName = "readBuffByCountryIdx";
    ResultSet resultSet = null;/*from w  w w .ja v a 2 s.  c o m*/
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + 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);
        }
        try {
            resultSet = stmtReadBuffByCountryIdx.executeQuery();
        } catch (SQLException e) {
            if (e.getErrorCode() != 1329) {
                throw e;
            }
            resultSet = null;
        }
        List<CFFswISOLanguageBuff> buffList = new LinkedList<CFFswISOLanguageBuff>();
        while ((resultSet != null) && resultSet.next()) {
            CFFswISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        int idx = 0;
        CFFswISOLanguageBuff[] retBuff = new CFFswISOLanguageBuff[buffList.size()];
        Iterator<CFFswISOLanguageBuff> 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.CFEnSyntaxMySql.CFEnSyntaxMySqlISOLanguageTable.java

public CFEnSyntaxISOLanguageBuff[] readBuffByCountryIdx(CFEnSyntaxAuthorization Authorization,
        Short ISOCountryId) {
    final String S_ProcName = "readBuffByCountryIdx";
    ResultSet resultSet = null;//from www  .  j a  v  a2 s  .  c o m
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + 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);
        }
        try {
            resultSet = stmtReadBuffByCountryIdx.executeQuery();
        } catch (SQLException e) {
            if (e.getErrorCode() != 1329) {
                throw e;
            }
            resultSet = null;
        }
        List<CFEnSyntaxISOLanguageBuff> buffList = new LinkedList<CFEnSyntaxISOLanguageBuff>();
        while ((resultSet != null) && 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.cfcrm.v2_1.CFCrmDb2LUW.CFCrmDb2LUWISOLanguageTable.java

public void createISOLanguage(CFCrmAuthorization Authorization, CFCrmISOLanguageBuff Buff) {
    final String S_ProcName = "createISOLanguage";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*from ww  w.  ja v  a  2 s  . c o m*/
    ResultSet resultSet = null;
    try {
        short Id = Buff.getRequiredId();
        String ISOCode = Buff.getRequiredISOCode();
        String BaseLanguageCode = Buff.getRequiredBaseLanguageCode();
        Short ISOCountryId = Buff.getOptionalISOCountryId();
        Connection cnx = schema.getCnx();
        final String sql = "CALL sp_create_iso_lang( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + " )";
        if (stmtCreateByPKey == null) {
            stmtCreateByPKey = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        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);
        }
        resultSet = stmtCreateByPKey.executeQuery();
        if (resultSet.next()) {
            CFCrmISOLanguageBuff 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().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.CFInternetDb2LUW.CFInternetDb2LUWISOLanguageTable.java

public void createISOLanguage(CFInternetAuthorization Authorization, CFInternetISOLanguageBuff Buff) {
    final String S_ProcName = "createISOLanguage";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/* www . j av a 2s  .  c  o m*/
    ResultSet resultSet = null;
    try {
        short Id = Buff.getRequiredId();
        String ISOCode = Buff.getRequiredISOCode();
        String BaseLanguageCode = Buff.getRequiredBaseLanguageCode();
        Short ISOCountryId = Buff.getOptionalISOCountryId();
        Connection cnx = schema.getCnx();
        final String sql = "CALL sp_create_iso_lang( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + " )";
        if (stmtCreateByPKey == null) {
            stmtCreateByPKey = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        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);
        }
        resultSet = stmtCreateByPKey.executeQuery();
        if (resultSet.next()) {
            CFInternetISOLanguageBuff 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().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.CFAsteriskDb2LUW.CFAsteriskDb2LUWISOLanguageTable.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  w  w .j av a  2  s  .  c  o m
    ResultSet resultSet = null;
    try {
        short Id = Buff.getRequiredId();
        String ISOCode = Buff.getRequiredISOCode();
        String BaseLanguageCode = Buff.getRequiredBaseLanguageCode();
        Short ISOCountryId = Buff.getOptionalISOCountryId();
        Connection cnx = schema.getCnx();
        final String sql = "CALL sp_create_iso_lang( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + " )";
        if (stmtCreateByPKey == null) {
            stmtCreateByPKey = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        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);
        }
        resultSet = stmtCreateByPKey.executeQuery();
        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().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.CFAccDb2LUW.CFAccDb2LUWISOLanguageTable.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  w  w w  .  j a va  2 s.com*/
    ResultSet resultSet = null;
    try {
        short Id = Buff.getRequiredId();
        String ISOCode = Buff.getRequiredISOCode();
        String BaseLanguageCode = Buff.getRequiredBaseLanguageCode();
        Short ISOCountryId = Buff.getOptionalISOCountryId();
        Connection cnx = schema.getCnx();
        final String sql = "CALL sp_create_iso_lang( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + " )";
        if (stmtCreateByPKey == null) {
            stmtCreateByPKey = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        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);
        }
        resultSet = stmtCreateByPKey.executeQuery();
        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().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.CFAstDb2LUW.CFAstDb2LUWISOLanguageTable.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.  ja v a2 s  . c om
    ResultSet resultSet = null;
    try {
        short Id = Buff.getRequiredId();
        String ISOCode = Buff.getRequiredISOCode();
        String BaseLanguageCode = Buff.getRequiredBaseLanguageCode();
        Short ISOCountryId = Buff.getOptionalISOCountryId();
        Connection cnx = schema.getCnx();
        final String sql = "CALL sp_create_iso_lang( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + " )";
        if (stmtCreateByPKey == null) {
            stmtCreateByPKey = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        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);
        }
        resultSet = stmtCreateByPKey.executeQuery();
        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().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.CFInternetOracle.CFInternetOracleISOLanguageTable.java

public void deleteISOLanguageByCountryIdx(CFInternetAuthorization Authorization, Short argISOCountryId) {
    final String S_ProcName = "deleteISOLanguageByCountryIdx";
    ResultSet resultSet = null;//  ww w.jav a2s  . com
    try {
        Connection cnx = schema.getCnx();
        String sql = "begin call " + schema.getLowerDbSchemaName() + ".dl_iso_langbycountryidx( ?, ?, ?, ?, ?"
                + ", " + "?" + " ); end";
        if (stmtDeleteByCountryIdx == null) {
            stmtDeleteByCountryIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (argISOCountryId != null) {
            stmtDeleteByCountryIdx.setShort(argIdx++, argISOCountryId.shortValue());
        } else {
            stmtDeleteByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        int rowsUpdated = stmtDeleteByCountryIdx.executeUpdate();
    } 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.cfsecurity.v2_0.CFSecurityOracle.CFSecurityOracleISOLanguageTable.java

public void deleteISOLanguageByCountryIdx(CFSecurityAuthorization Authorization, Short argISOCountryId) {
    final String S_ProcName = "deleteISOLanguageByCountryIdx";
    ResultSet resultSet = null;//from   ww w.  j av  a 2 s . com
    try {
        Connection cnx = schema.getCnx();
        String sql = "begin call " + schema.getLowerSchemaDbName() + ".dl_iso_langbycountryidx( ?, ?, ?, ?, ?"
                + ", " + "?" + " ); end";
        if (stmtDeleteByCountryIdx == null) {
            stmtDeleteByCountryIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByCountryIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (argISOCountryId != null) {
            stmtDeleteByCountryIdx.setShort(argIdx++, argISOCountryId.shortValue());
        } else {
            stmtDeleteByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        int rowsUpdated = stmtDeleteByCountryIdx.executeUpdate();
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}