Example usage for java.sql Types INTEGER

List of usage examples for java.sql Types INTEGER

Introduction

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

Prototype

int INTEGER

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

Click Source Link

Document

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

Usage

From source file:net.sourceforge.msscodefactory.cfcore.v2_0.CFGenKbMySql.CFGenKbMySqlGelPrefixLineTable.java

public CFGenKbGelPrefixLineBuff[] readBuffByNextIdx(CFGenKbAuthorization Authorization, long TenantId,
        long CartridgeId, Integer NextId) {
    final String S_ProcName = "readBuffByNextIdx";
    ResultSet resultSet = null;/*from   w ww  . j  a va 2  s.co  m*/
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerSchemaDbName() + ".sp_read_gelprefix_by_nextidx( ?, ?, ?, ?, ?"
                + ", " + "?" + ", " + "?" + ", " + "?" + " )";
        if (stmtReadBuffByNextIdx == null) {
            stmtReadBuffByNextIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByNextIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByNextIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByNextIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByNextIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByNextIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByNextIdx.setLong(argIdx++, TenantId);
        stmtReadBuffByNextIdx.setLong(argIdx++, CartridgeId);
        if (NextId != null) {
            stmtReadBuffByNextIdx.setInt(argIdx++, NextId.intValue());
        } else {
            stmtReadBuffByNextIdx.setNull(argIdx++, java.sql.Types.INTEGER);
        }
        try {
            resultSet = stmtReadBuffByNextIdx.executeQuery();
        } catch (SQLException e) {
            if (e.getErrorCode() != 1329) {
                throw e;
            }
            resultSet = null;
        }
        List<CFGenKbGelPrefixLineBuff> buffList = new LinkedList<CFGenKbGelPrefixLineBuff>();
        while ((resultSet != null) && resultSet.next()) {
            CFGenKbGelPrefixLineBuff buff = unpackGelPrefixLineResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        int idx = 0;
        CFGenKbGelPrefixLineBuff[] retBuff = new CFGenKbGelPrefixLineBuff[buffList.size()];
        Iterator<CFGenKbGelPrefixLineBuff> 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.cfcore.v2_0.CFGenKbMySql.CFGenKbMySqlGelModifierTable.java

public CFGenKbGelModifierBuff[] readBuffByPrevIdx(CFGenKbAuthorization Authorization, long TenantId,
        long CartridgeId, Integer PrevId) {
    final String S_ProcName = "readBuffByPrevIdx";
    ResultSet resultSet = null;/*  w  w w.j  a  v a2s.c om*/
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerSchemaDbName() + ".sp_read_gelmodifier_by_previdx( ?, ?, ?, ?, ?"
                + ", " + "?" + ", " + "?" + ", " + "?" + " )";
        if (stmtReadBuffByPrevIdx == null) {
            stmtReadBuffByPrevIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByPrevIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByPrevIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByPrevIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByPrevIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByPrevIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByPrevIdx.setLong(argIdx++, TenantId);
        stmtReadBuffByPrevIdx.setLong(argIdx++, CartridgeId);
        if (PrevId != null) {
            stmtReadBuffByPrevIdx.setInt(argIdx++, PrevId.intValue());
        } else {
            stmtReadBuffByPrevIdx.setNull(argIdx++, java.sql.Types.INTEGER);
        }
        try {
            resultSet = stmtReadBuffByPrevIdx.executeQuery();
        } catch (SQLException e) {
            if (e.getErrorCode() != 1329) {
                throw e;
            }
            resultSet = null;
        }
        List<CFGenKbGelModifierBuff> buffList = new LinkedList<CFGenKbGelModifierBuff>();
        while ((resultSet != null) && resultSet.next()) {
            CFGenKbGelModifierBuff buff = unpackGelModifierResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        int idx = 0;
        CFGenKbGelModifierBuff[] retBuff = new CFGenKbGelModifierBuff[buffList.size()];
        Iterator<CFGenKbGelModifierBuff> 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.CFAccOracle.CFAccOracleAttachmentTable.java

public void updateAttachment(CFAccAuthorization Authorization, CFAccAttachmentBuff Buff) {
    final String S_ProcName = "updateAttachment";
    ResultSet resultSet = null;//from  w  w w .j  a  v a 2  s. c  om
    Connection cnx = schema.getCnx();
    CallableStatement stmtUpdateByPKey = null;
    List<CFAccAttachmentBuff> buffList = new LinkedList<CFAccAttachmentBuff>();
    try {
        long TenantId = Buff.getRequiredTenantId();
        long AttachmentId = Buff.getRequiredAttachmentId();
        long ContactId = Buff.getRequiredContactId();
        String Description = Buff.getRequiredDescription();
        Integer MimeTypeId = Buff.getOptionalMimeTypeId();
        String Attachment = Buff.getRequiredAttachment();
        int Revision = Buff.getRequiredRevision();
        stmtUpdateByPKey = cnx.prepareCall(
                "begin " + schema.getLowerSchemaDbName() + ".upd_attchmnt( ?, ?, ?, ?, ?, ?, ?" + ", " + "?"
                        + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); 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++, "ATTC");
        stmtUpdateByPKey.setLong(argIdx++, TenantId);
        stmtUpdateByPKey.setLong(argIdx++, AttachmentId);
        stmtUpdateByPKey.setLong(argIdx++, ContactId);
        stmtUpdateByPKey.setString(argIdx++, Description);
        if (MimeTypeId != null) {
            stmtUpdateByPKey.setInt(argIdx++, MimeTypeId.intValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.INTEGER);
        }
        stmtUpdateByPKey.setString(argIdx++, Attachment);
        stmtUpdateByPKey.setInt(argIdx++, Revision);
        stmtUpdateByPKey.execute();
        resultSet = (ResultSet) stmtUpdateByPKey.getObject(1);
        if (resultSet != null) {
            try {
                if (resultSet.next()) {
                    CFAccAttachmentBuff updatedBuff = unpackAttachmentResultSetToBuff(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.setRequiredDescription(updatedBuff.getRequiredDescription());
                    Buff.setOptionalMimeTypeId(updatedBuff.getOptionalMimeTypeId());
                    Buff.setRequiredAttachment(updatedBuff.getRequiredAttachment());
                    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_attchmnt() 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_attchmnt() 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.cfcore.v2_0.CFGenKbMySql.CFGenKbMySqlGelIteratorTable.java

public CFGenKbGelIteratorBuff[] readBuffByCallerIdx(CFGenKbAuthorization Authorization, long TenantId,
        long CartridgeId, Integer CallerId) {
    final String S_ProcName = "readBuffByCallerIdx";
    ResultSet resultSet = null;/*from  www.  j a va2  s  . c  o  m*/
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerSchemaDbName() + ".sp_read_geliter_by_calleridx( ?, ?, ?, ?, ?"
                + ", " + "?" + ", " + "?" + ", " + "?" + " )";
        if (stmtReadBuffByCallerIdx == null) {
            stmtReadBuffByCallerIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByCallerIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCallerIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByCallerIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByCallerIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCallerIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByCallerIdx.setLong(argIdx++, TenantId);
        stmtReadBuffByCallerIdx.setLong(argIdx++, CartridgeId);
        if (CallerId != null) {
            stmtReadBuffByCallerIdx.setInt(argIdx++, CallerId.intValue());
        } else {
            stmtReadBuffByCallerIdx.setNull(argIdx++, java.sql.Types.INTEGER);
        }
        try {
            resultSet = stmtReadBuffByCallerIdx.executeQuery();
        } catch (SQLException e) {
            if (e.getErrorCode() != 1329) {
                throw e;
            }
            resultSet = null;
        }
        List<CFGenKbGelIteratorBuff> buffList = new LinkedList<CFGenKbGelIteratorBuff>();
        while ((resultSet != null) && resultSet.next()) {
            CFGenKbGelIteratorBuff buff = unpackGelIteratorResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        int idx = 0;
        CFGenKbGelIteratorBuff[] retBuff = new CFGenKbGelIteratorBuff[buffList.size()];
        Iterator<CFGenKbGelIteratorBuff> 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:com.streamsets.pipeline.lib.jdbc.multithread.TestMultithreadedTableProvider.java

@NotNull
private static TableContext createTableContext(String schema, String tableName, String offsetColumn,
        String partitionSize, String minOffsetColValue, int maxActivePartitions, boolean enablePartitioning,
        boolean enableNonIncremental) {
    LinkedHashMap<String, Integer> offsetColumnToType = new LinkedHashMap<>();
    Map<String, String> offsetColumnToStartOffset = new HashMap<>();
    Map<String, String> offsetColumnToPartitionSizes = new HashMap<>();
    Map<String, String> offsetColumnToMinValues = new HashMap<>();

    if (offsetColumn != null) {
        offsetColumnToType.put(offsetColumn, Types.INTEGER);
        if (minOffsetColValue != null) {
            offsetColumnToMinValues.put(offsetColumn, minOffsetColValue);
        }//  w  w w.j a va  2  s. com
        offsetColumnToPartitionSizes.put(offsetColumn, partitionSize);
    }
    String extraOffsetColumnConditions = null;

    return new TableContext(schema, tableName, offsetColumnToType, offsetColumnToStartOffset,
            offsetColumnToPartitionSizes, offsetColumnToMinValues, enableNonIncremental,
            enablePartitioning ? PartitioningMode.BEST_EFFORT : PartitioningMode.DISABLED, maxActivePartitions,
            extraOffsetColumnConditions);
}

From source file:net.sourceforge.msscodefactory.cfcore.v2_0.CFGenKbMySql.CFGenKbMySqlGelPopTable.java

public CFGenKbGelPopBuff[] readBuffByRemainderIdx(CFGenKbAuthorization Authorization, long TenantId,
        long CartridgeId, Integer RemainderInstId) {
    final String S_ProcName = "readBuffByRemainderIdx";
    ResultSet resultSet = null;//from w w w . java2  s  .co m
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerSchemaDbName() + ".sp_read_gelpop_by_remainderidx( ?, ?, ?, ?, ?"
                + ", " + "?" + ", " + "?" + ", " + "?" + " )";
        if (stmtReadBuffByRemainderIdx == null) {
            stmtReadBuffByRemainderIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByRemainderIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByRemainderIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByRemainderIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByRemainderIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByRemainderIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByRemainderIdx.setLong(argIdx++, TenantId);
        stmtReadBuffByRemainderIdx.setLong(argIdx++, CartridgeId);
        if (RemainderInstId != null) {
            stmtReadBuffByRemainderIdx.setInt(argIdx++, RemainderInstId.intValue());
        } else {
            stmtReadBuffByRemainderIdx.setNull(argIdx++, java.sql.Types.INTEGER);
        }
        try {
            resultSet = stmtReadBuffByRemainderIdx.executeQuery();
        } catch (SQLException e) {
            if (e.getErrorCode() != 1329) {
                throw e;
            }
            resultSet = null;
        }
        List<CFGenKbGelPopBuff> buffList = new LinkedList<CFGenKbGelPopBuff>();
        while ((resultSet != null) && resultSet.next()) {
            CFGenKbGelPopBuff buff = unpackGelPopResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        int idx = 0;
        CFGenKbGelPopBuff[] retBuff = new CFGenKbGelPopBuff[buffList.size()];
        Iterator<CFGenKbGelPopBuff> 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.cfcore.v2_0.CFGenKbOracle.CFGenKbOracleGelExpansionTable.java

public CFGenKbGelExpansionBuff[] readBuffByNextIdx(CFGenKbAuthorization Authorization, long TenantId,
        long CartridgeId, Integer NextId) {
    final String S_ProcName = "readBuffByNextIdx";
    ResultSet resultSet = null;/*  w ww . j  a  v  a2  s. c o m*/
    Connection cnx = schema.getCnx();
    CallableStatement stmtReadBuffByNextIdx = null;
    List<CFGenKbGelExpansionBuff> buffList = new LinkedList<CFGenKbGelExpansionBuff>();
    try {
        stmtReadBuffByNextIdx = cnx.prepareCall(
                "begin " + schema.getLowerSchemaDbName() + ".rd_gelexpansionbynextidx( ?, ?, ?, ?, ?, ?" + ", "
                        + "?" + ", " + "?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtReadBuffByNextIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadBuffByNextIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByNextIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByNextIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByNextIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByNextIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByNextIdx.setLong(argIdx++, TenantId);
        stmtReadBuffByNextIdx.setLong(argIdx++, CartridgeId);
        if (NextId != null) {
            stmtReadBuffByNextIdx.setInt(argIdx++, NextId.intValue());
        } else {
            stmtReadBuffByNextIdx.setNull(argIdx++, java.sql.Types.INTEGER);
        }
        stmtReadBuffByNextIdx.execute();
        resultSet = (ResultSet) stmtReadBuffByNextIdx.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    CFGenKbGelExpansionBuff buff = unpackGelExpansionResultSetToBuff(resultSet);
                    buffList.add(buff);
                }
                try {
                    resultSet.close();
                } catch (SQLException e) {
                }
                resultSet = null;
            } catch (SQLException e) {
            }
        }
        int idx = 0;
        CFGenKbGelExpansionBuff[] retBuff = new CFGenKbGelExpansionBuff[buffList.size()];
        Iterator<CFGenKbGelExpansionBuff> 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 (stmtReadBuffByNextIdx != null) {
            try {
                stmtReadBuffByNextIdx.close();
            } catch (SQLException e) {
            }
            stmtReadBuffByNextIdx = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfcore.v2_0.CFGenKbMySql.CFGenKbMySqlGelReferenceTable.java

public CFGenKbGelReferenceBuff[] readBuffByRemainderIdx(CFGenKbAuthorization Authorization, long TenantId,
        long CartridgeId, Integer RemainderInstId) {
    final String S_ProcName = "readBuffByRemainderIdx";
    ResultSet resultSet = null;// w ww  .  j  a  v  a 2  s.c  o  m
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerSchemaDbName()
                + ".sp_read_gelrefer_by_remainderidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?"
                + " )";
        if (stmtReadBuffByRemainderIdx == null) {
            stmtReadBuffByRemainderIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByRemainderIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByRemainderIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByRemainderIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByRemainderIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByRemainderIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByRemainderIdx.setLong(argIdx++, TenantId);
        stmtReadBuffByRemainderIdx.setLong(argIdx++, CartridgeId);
        if (RemainderInstId != null) {
            stmtReadBuffByRemainderIdx.setInt(argIdx++, RemainderInstId.intValue());
        } else {
            stmtReadBuffByRemainderIdx.setNull(argIdx++, java.sql.Types.INTEGER);
        }
        try {
            resultSet = stmtReadBuffByRemainderIdx.executeQuery();
        } catch (SQLException e) {
            if (e.getErrorCode() != 1329) {
                throw e;
            }
            resultSet = null;
        }
        List<CFGenKbGelReferenceBuff> buffList = new LinkedList<CFGenKbGelReferenceBuff>();
        while ((resultSet != null) && resultSet.next()) {
            CFGenKbGelReferenceBuff buff = unpackGelReferenceResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        int idx = 0;
        CFGenKbGelReferenceBuff[] retBuff = new CFGenKbGelReferenceBuff[buffList.size()];
        Iterator<CFGenKbGelReferenceBuff> 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.cfcore.v2_0.CFGenKbMySql.CFGenKbMySqlGelPrefixLineTable.java

public CFGenKbGelPrefixLineBuff[] readBuffByRemainderIdx(CFGenKbAuthorization Authorization, long TenantId,
        long CartridgeId, Integer RemainderInstId) {
    final String S_ProcName = "readBuffByRemainderIdx";
    ResultSet resultSet = null;/*from  w  w  w.  jav  a2s . co m*/
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerSchemaDbName()
                + ".sp_read_gelprefix_by_remainderidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?"
                + " )";
        if (stmtReadBuffByRemainderIdx == null) {
            stmtReadBuffByRemainderIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByRemainderIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByRemainderIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByRemainderIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByRemainderIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByRemainderIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByRemainderIdx.setLong(argIdx++, TenantId);
        stmtReadBuffByRemainderIdx.setLong(argIdx++, CartridgeId);
        if (RemainderInstId != null) {
            stmtReadBuffByRemainderIdx.setInt(argIdx++, RemainderInstId.intValue());
        } else {
            stmtReadBuffByRemainderIdx.setNull(argIdx++, java.sql.Types.INTEGER);
        }
        try {
            resultSet = stmtReadBuffByRemainderIdx.executeQuery();
        } catch (SQLException e) {
            if (e.getErrorCode() != 1329) {
                throw e;
            }
            resultSet = null;
        }
        List<CFGenKbGelPrefixLineBuff> buffList = new LinkedList<CFGenKbGelPrefixLineBuff>();
        while ((resultSet != null) && resultSet.next()) {
            CFGenKbGelPrefixLineBuff buff = unpackGelPrefixLineResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        int idx = 0;
        CFGenKbGelPrefixLineBuff[] retBuff = new CFGenKbGelPrefixLineBuff[buffList.size()];
        Iterator<CFGenKbGelPrefixLineBuff> 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.cfcore.v2_0.CFGenKbMySql.CFGenKbMySqlGelModifierTable.java

public CFGenKbGelModifierBuff[] readBuffByNextIdx(CFGenKbAuthorization Authorization, long TenantId,
        long CartridgeId, Integer NextId) {
    final String S_ProcName = "readBuffByNextIdx";
    ResultSet resultSet = null;// w  w w . ja  v a 2s  .  c om
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerSchemaDbName() + ".sp_read_gelmodifier_by_nextidx( ?, ?, ?, ?, ?"
                + ", " + "?" + ", " + "?" + ", " + "?" + " )";
        if (stmtReadBuffByNextIdx == null) {
            stmtReadBuffByNextIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByNextIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByNextIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByNextIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByNextIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByNextIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByNextIdx.setLong(argIdx++, TenantId);
        stmtReadBuffByNextIdx.setLong(argIdx++, CartridgeId);
        if (NextId != null) {
            stmtReadBuffByNextIdx.setInt(argIdx++, NextId.intValue());
        } else {
            stmtReadBuffByNextIdx.setNull(argIdx++, java.sql.Types.INTEGER);
        }
        try {
            resultSet = stmtReadBuffByNextIdx.executeQuery();
        } catch (SQLException e) {
            if (e.getErrorCode() != 1329) {
                throw e;
            }
            resultSet = null;
        }
        List<CFGenKbGelModifierBuff> buffList = new LinkedList<CFGenKbGelModifierBuff>();
        while ((resultSet != null) && resultSet.next()) {
            CFGenKbGelModifierBuff buff = unpackGelModifierResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        int idx = 0;
        CFGenKbGelModifierBuff[] retBuff = new CFGenKbGelModifierBuff[buffList.size()];
        Iterator<CFGenKbGelModifierBuff> 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;
        }
    }
}