Example usage for java.sql Types SMALLINT

List of usage examples for java.sql Types SMALLINT

Introduction

In this page you can find the example usage for java.sql Types SMALLINT.

Prototype

int SMALLINT

To view the source code for java.sql Types SMALLINT.

Click Source Link

Document

The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type SMALLINT.

Usage

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskMySql.CFAsteriskMySqlISOLanguageTable.java

public void deleteISOLanguageByCountryIdx(CFSecurityAuthorization Authorization, Short argISOCountryId) {
    final String S_ProcName = "deleteISOLanguageByCountryIdx";
    ResultSet resultSet = null;//from w w w  .  j a  va 2  s.c o m
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerDbSchemaName()
                + ".sp_delete_iso_lang_by_countryidx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
        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);
        }
        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.cfasterisk.v2_4.CFAsteriskMSSql.CFAsteriskMSSqlISOLanguageTable.java

public void deleteISOLanguageByCountryIdx(CFSecurityAuthorization Authorization, Short argISOCountryId) {
    final String S_ProcName = "deleteISOLanguageByCountryIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }// w w  w .j ava 2s.c om
    ResultSet resultSet = null;
    try {
        Connection cnx = schema.getCnx();
        String sql = "exec sp_delete_iso_lang_by_countryidx ?, ?, ?, ?, ?" + ", " + "?";
        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);
        }
        Object stuff = null;
        boolean moreResults = stmtDeleteByCountryIdx.execute();
        while (stuff == null) {
            try {
                moreResults = stmtDeleteByCountryIdx.getMoreResults();
            } catch (SQLException e) {
                throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
            }
            if (moreResults) {
                try {
                    stuff = stmtDeleteByCountryIdx.getResultSet();
                } catch (SQLException e) {
                }
            } else if (-1 == stmtDeleteByCountryIdx.getUpdateCount()) {
                break;
            }
        }
    } 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 void deleteISOLanguageByCountryIdx(CFFswAuthorization Authorization, Short argISOCountryId) {
    final String S_ProcName = "deleteISOLanguageByCountryIdx";
    ResultSet resultSet = null;// ww w.  j  a v a  2s.  c o m
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerDbSchemaName()
                + ".sp_delete_iso_lang_by_countryidx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
        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);
        }
        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.cfacc.v2_0.CFAccMySql.CFAccMySqlAddressTable.java

public void updateAddress(CFAccAuthorization Authorization, CFAccAddressBuff Buff) {
    final String S_ProcName = "updateAddress";
    ResultSet resultSet = null;//from w w w  .  java  2  s.  c  o  m
    try {
        long TenantId = Buff.getRequiredTenantId();
        long AddressId = Buff.getRequiredAddressId();
        long ContactId = Buff.getRequiredContactId();
        String Description = Buff.getRequiredDescription();
        String AddrLine1 = Buff.getOptionalAddrLine1();
        String AddrLine2 = Buff.getOptionalAddrLine2();
        String City = Buff.getOptionalCity();
        String State = Buff.getOptionalState();
        Short CountryId = Buff.getOptionalCountryId();
        String Zip = Buff.getOptionalZip();
        int Revision = Buff.getRequiredRevision();
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerSchemaDbName() + ".sp_update_address( ?, ?, ?, ?, ?, ?" + ", "
                + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + ", " + "?" + " )";
        if (stmtUpdateByPKey == null) {
            stmtUpdateByPKey = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        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++, "ADR");
        stmtUpdateByPKey.setLong(argIdx++, TenantId);
        stmtUpdateByPKey.setLong(argIdx++, AddressId);
        stmtUpdateByPKey.setLong(argIdx++, ContactId);
        stmtUpdateByPKey.setString(argIdx++, Description);
        if (AddrLine1 != null) {
            stmtUpdateByPKey.setString(argIdx++, AddrLine1);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (AddrLine2 != null) {
            stmtUpdateByPKey.setString(argIdx++, AddrLine2);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (City != null) {
            stmtUpdateByPKey.setString(argIdx++, City);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (State != null) {
            stmtUpdateByPKey.setString(argIdx++, State);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        if (CountryId != null) {
            stmtUpdateByPKey.setShort(argIdx++, CountryId.shortValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        if (Zip != null) {
            stmtUpdateByPKey.setString(argIdx++, Zip);
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
        }
        stmtUpdateByPKey.setInt(argIdx++, Revision);
        try {
            resultSet = stmtUpdateByPKey.executeQuery();
        } catch (SQLException e) {
            if (e.getErrorCode() != 1329) {
                throw e;
            }
            resultSet = null;
        }
        if ((resultSet != null) && resultSet.next()) {
            CFAccAddressBuff updatedBuff = unpackAddressResultSetToBuff(resultSet);
            if ((resultSet != null) && resultSet.next()) {
                resultSet.last();
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
            }
            Buff.setRequiredContactId(updatedBuff.getRequiredContactId());
            Buff.setRequiredDescription(updatedBuff.getRequiredDescription());
            Buff.setOptionalAddrLine1(updatedBuff.getOptionalAddrLine1());
            Buff.setOptionalAddrLine2(updatedBuff.getOptionalAddrLine2());
            Buff.setOptionalCity(updatedBuff.getOptionalCity());
            Buff.setOptionalState(updatedBuff.getOptionalState());
            Buff.setOptionalCountryId(updatedBuff.getOptionalCountryId());
            Buff.setOptionalZip(updatedBuff.getOptionalZip());
            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().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.CFAstMySql.CFAstMySqlISOLanguageTable.java

public void deleteISOLanguageByCountryIdx(CFAstAuthorization Authorization, Short argISOCountryId) {
    final String S_ProcName = "deleteISOLanguageByCountryIdx";
    ResultSet resultSet = null;//from   w  w  w  . j a va  2  s  .c  om
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerSchemaDbName()
                + ".sp_delete_iso_lang_by_countryidx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
        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);
        }
        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.cfasterisk.v2_1.CFAstMySql.CFAstMySqlISOLanguageTable.java

public void deleteISOLanguageByCountryIdx(CFAstAuthorization Authorization, Short argISOCountryId) {
    final String S_ProcName = "deleteISOLanguageByCountryIdx";
    ResultSet resultSet = null;//from www  .  j av a 2s .  co  m
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerDbSchemaName()
                + ".sp_delete_iso_lang_by_countryidx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
        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);
        }
        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.cfacc.v2_0.CFAccMySql.CFAccMySqlISOLanguageTable.java

public void deleteISOLanguageByCountryIdx(CFAccAuthorization Authorization, Short argISOCountryId) {
    final String S_ProcName = "deleteISOLanguageByCountryIdx";
    ResultSet resultSet = null;/*www .  j  a va 2s.  c o m*/
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerSchemaDbName()
                + ".sp_delete_iso_lang_by_countryidx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
        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);
        }
        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.cfacc.v2_0.CFAccOracle.CFAccOracleContactURLTable.java

public void updateContactURL(CFAccAuthorization Authorization, CFAccContactURLBuff Buff) {
    final String S_ProcName = "updateContactURL";
    ResultSet resultSet = null;//  ww  w  .  ja  va  2  s.com
    Connection cnx = schema.getCnx();
    CallableStatement stmtUpdateByPKey = null;
    List<CFAccContactURLBuff> buffList = new LinkedList<CFAccContactURLBuff>();
    try {
        long TenantId = Buff.getRequiredTenantId();
        long ContactURLId = Buff.getRequiredContactURLId();
        long ContactId = Buff.getRequiredContactId();
        Short URLProtocolId = Buff.getOptionalURLProtocolId();
        String Name = Buff.getRequiredName();
        String URL = Buff.getRequiredURL();
        int Revision = Buff.getRequiredRevision();
        stmtUpdateByPKey = cnx.prepareCall(
                "begin " + schema.getLowerSchemaDbName() + ".upd_ctcurl( ?, ?, ?, ?, ?, ?, ?" + ", " + "?"
                        + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); 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++, "CURL");
        stmtUpdateByPKey.setLong(argIdx++, TenantId);
        stmtUpdateByPKey.setLong(argIdx++, ContactURLId);
        stmtUpdateByPKey.setLong(argIdx++, ContactId);
        if (URLProtocolId != null) {
            stmtUpdateByPKey.setShort(argIdx++, URLProtocolId.shortValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT);
        }
        stmtUpdateByPKey.setString(argIdx++, Name);
        stmtUpdateByPKey.setString(argIdx++, URL);
        stmtUpdateByPKey.setInt(argIdx++, Revision);
        stmtUpdateByPKey.execute();
        resultSet = (ResultSet) stmtUpdateByPKey.getObject(1);
        if (resultSet != null) {
            try {
                if (resultSet.next()) {
                    CFAccContactURLBuff updatedBuff = unpackContactURLResultSetToBuff(resultSet);
                    if (resultSet.next()) {
                        resultSet.last();
                        throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                                "Did not expect multi-record response, " + resultSet.getRow()
                                        + " rows selected");
                    }
                    Buff.setRequiredContactId(updatedBuff.getRequiredContactId());
                    Buff.setOptionalURLProtocolId(updatedBuff.getOptionalURLProtocolId());
                    Buff.setRequiredName(updatedBuff.getRequiredName());
                    Buff.setRequiredURL(updatedBuff.getRequiredURL());
                    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_ctcurl() 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_ctcurl() did not return a result cursor");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
        if (stmtUpdateByPKey != null) {
            try {
                stmtUpdateByPKey.close();
            } catch (SQLException e) {
            }
            stmtUpdateByPKey = null;
        }
    }
}

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

public void deleteISOLanguageByCountryIdx(CFAstAuthorization Authorization, Short argISOCountryId) {
    final String S_ProcName = "deleteISOLanguageByCountryIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }// w  w  w.  ja v a  2 s  .  co m
    ResultSet resultSet = null;
    try {
        Connection cnx = schema.getCnx();
        String sql = "exec sp_delete_iso_lang_by_countryidx ?, ?, ?, ?, ?" + ", " + "?";
        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);
        }
        Object stuff = null;
        boolean moreResults = stmtDeleteByCountryIdx.execute();
        while (stuff == null) {
            try {
                moreResults = stmtDeleteByCountryIdx.getMoreResults();
            } catch (SQLException e) {
                throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
            }
            if (moreResults) {
                try {
                    stuff = stmtDeleteByCountryIdx.getResultSet();
                } catch (SQLException e) {
                }
            } else if (-1 == stmtDeleteByCountryIdx.getUpdateCount()) {
                break;
            }
        }
    } 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 void deleteISOLanguageByCountryIdx(CFAccAuthorization Authorization, Short argISOCountryId) {
    final String S_ProcName = "deleteISOLanguageByCountryIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*from   w ww.jav a2s  .  c om*/
    ResultSet resultSet = null;
    try {
        Connection cnx = schema.getCnx();
        String sql = "exec sp_delete_iso_lang_by_countryidx ?, ?, ?, ?, ?" + ", " + "?";
        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);
        }
        Object stuff = null;
        boolean moreResults = stmtDeleteByCountryIdx.execute();
        while (stuff == null) {
            try {
                moreResults = stmtDeleteByCountryIdx.getMoreResults();
            } catch (SQLException e) {
                throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
            }
            if (moreResults) {
                try {
                    stuff = stmtDeleteByCountryIdx.getResultSet();
                } catch (SQLException e) {
                }
            } else if (-1 == stmtDeleteByCountryIdx.getUpdateCount()) {
                break;
            }
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}