Example usage for java.sql ResultSet CONCUR_READ_ONLY

List of usage examples for java.sql ResultSet CONCUR_READ_ONLY

Introduction

In this page you can find the example usage for java.sql ResultSet CONCUR_READ_ONLY.

Prototype

int CONCUR_READ_ONLY

To view the source code for java.sql ResultSet CONCUR_READ_ONLY.

Click Source Link

Document

The constant indicating the concurrency mode for a ResultSet object that may NOT be updated.

Usage

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8BoolDefTable.java

public MSSBamBoolDefBuff[] readDerivedByContNextIdx(MSSBamAuthorization Authorization, long ValueContainerId,
        Long NextId) {//w w w .j  a  v a 2s.c o m
    final String S_ProcName = "readDerivedByContNextIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectBoolDefDistinctClassCode + "WHERE " + "val.ValueContainerId = "
                + Long.toString(ValueContainerId) + " " + "AND "
                + ((NextId == null) ? "val.NextId is null " : "val.NextId = " + NextId.toString() + " ");
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
    ArrayList<MSSBamBoolDefBuff> resultList = new ArrayList<MSSBamBoolDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("BLN")) {
            MSSBamBoolDefBuff[] subList = readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("TBLN")) {
            MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByContNextIdx(Authorization,
                    ValueContainerId, NextId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("SBLN")) {
            MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByContNextIdx(Authorization,
                    ValueContainerId, NextId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamBoolDefBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8BlobDefTable.java

public MSSBamBlobDefBuff[] readDerivedByContNextIdx(MSSBamAuthorization Authorization, long ValueContainerId,
        Long NextId) {//from  w  w  w  .ja v a2  s.  c o  m
    final String S_ProcName = "readDerivedByContNextIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectBlobDefDistinctClassCode + "WHERE " + "val.ValueContainerId = "
                + Long.toString(ValueContainerId) + " " + "AND "
                + ((NextId == null) ? "val.NextId is null " : "val.NextId = " + NextId.toString() + " ");
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
    ArrayList<MSSBamBlobDefBuff> resultList = new ArrayList<MSSBamBlobDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("BLB")) {
            MSSBamBlobDefBuff[] subList = readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("TBLB")) {
            MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByContNextIdx(Authorization,
                    ValueContainerId, NextId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("SBLB")) {
            MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByContNextIdx(Authorization,
                    ValueContainerId, NextId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamBlobDefBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8AnyObjTable.java

public MSSBamAnyObjBuff readDerivedByIdIdx(MSSBamAuthorization Authorization, long Id) {
    final String S_ProcName = "MSSBamPg8AnyObjTable.readDerivedByIdIdx() ";
    MSSBamAnyObjBuff buff;/*from w  w w  .j av a 2  s.c  o  m*/
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectAnyObjDistinctClassCode + "WHERE " + "anyo.Id = " + Long.toString(Id) + " ";
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        if (resultSet.next()) {
            classCode = resultSet.getString(1);
            if (resultSet.next()) {
                resultSet.last();
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-buff response, " + resultSet.getRow() + " rows selected");
            }
        } else {
            return (null);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
    if (classCode.equals("ANYO")) {
        buff = readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SCP")) {
        buff = schema.getTableScope().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("DICT")) {
        buff = schema.getTableDictionary().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("RMD")) {
        buff = schema.getTableMSSBam().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("BDM")) {
        buff = schema.getTableBaseDomain().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("DOM")) {
        buff = schema.getTableDomain().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("LENT")) {
        buff = schema.getTableLegalEntity().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("COM")) {
        buff = schema.getTableCompany().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("USR")) {
        buff = schema.getTableUser().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("PRJ")) {
        buff = schema.getTableProject().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("VER")) {
        buff = schema.getTableVersion().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("MJV")) {
        buff = schema.getTableMajorVersion().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("MNV")) {
        buff = schema.getTableMinorVersion().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TLD")) {
        buff = schema.getTableTLD().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("IDX")) {
        buff = schema.getTableIndex().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("REL")) {
        buff = schema.getTableRelation().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SCH")) {
        buff = schema.getTableSchemaDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TBL")) {
        buff = schema.getTableTable().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("VAL")) {
        buff = schema.getTableValue().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("ATM")) {
        buff = schema.getTableAtomDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("BLB")) {
        buff = schema.getTableBlobDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TBLB")) {
        buff = schema.getTableTableBlob().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SBLB")) {
        buff = schema.getTableSchemaBlob().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("BLN")) {
        buff = schema.getTableBoolDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TBLN")) {
        buff = schema.getTableTableBool().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SBLN")) {
        buff = schema.getTableSchemaBool().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("DAT")) {
        buff = schema.getTableDateDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TDAT")) {
        buff = schema.getTableTableDate().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SDAT")) {
        buff = schema.getTableSchemaDate().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("DBL")) {
        buff = schema.getTableDoubleDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TDBL")) {
        buff = schema.getTableTableDouble().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SDBL")) {
        buff = schema.getTableSchemaDouble().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("NUM")) {
        buff = schema.getTableNumberDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TNUM")) {
        buff = schema.getTableTableNumber().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SNUM")) {
        buff = schema.getTableSchemaNumber().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("FLT")) {
        buff = schema.getTableFloatDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TFLT")) {
        buff = schema.getTableTableFloat().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SFLT")) {
        buff = schema.getTableSchemaFloat().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("I16")) {
        buff = schema.getTableInt16Def().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TI16")) {
        buff = schema.getTableTableInt16().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SI16")) {
        buff = schema.getTableSchemaInt16().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("ENM")) {
        buff = schema.getTableEnumDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TENM")) {
        buff = schema.getTableTableEnum().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SENM")) {
        buff = schema.getTableSchemaEnum().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("G16")) {
        buff = schema.getTableId16GenDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TG16")) {
        buff = schema.getTableTableId16Gen().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SG16")) {
        buff = schema.getTableSchemaId16Gen().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("U16")) {
        buff = schema.getTableUInt16Def().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TU16")) {
        buff = schema.getTableTableUInt16().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SU16")) {
        buff = schema.getTableSchemaUInt16().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("I32")) {
        buff = schema.getTableInt32Def().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TI32")) {
        buff = schema.getTableTableInt32().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SI32")) {
        buff = schema.getTableSchemaInt32().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("G32")) {
        buff = schema.getTableId32GenDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TG32")) {
        buff = schema.getTableTableId32Gen().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SG32")) {
        buff = schema.getTableSchemaId32Gen().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("U32")) {
        buff = schema.getTableUInt32Def().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TU32")) {
        buff = schema.getTableTableUInt32().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SU32")) {
        buff = schema.getTableSchemaUInt32().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("I64")) {
        buff = schema.getTableInt64Def().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TI64")) {
        buff = schema.getTableTableInt64().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SI64")) {
        buff = schema.getTableSchemaInt64().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("G64")) {
        buff = schema.getTableId64GenDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TG64")) {
        buff = schema.getTableTableId64Gen().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SG64")) {
        buff = schema.getTableSchemaId64Gen().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("U64")) {
        buff = schema.getTableUInt64Def().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TU64")) {
        buff = schema.getTableTableUInt64().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SU64")) {
        buff = schema.getTableSchemaUInt64().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("UUID")) {
        buff = schema.getTableUuidDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TUUI")) {
        buff = schema.getTableTableUuid().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SUUI")) {
        buff = schema.getTableSchemaUuid().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("IDGU")) {
        buff = schema.getTableUuidGenDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TGUU")) {
        buff = schema.getTableTableUuidGen().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SGUU")) {
        buff = schema.getTableSchemaUuidGen().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("NMT")) {
        buff = schema.getTableNmTokenDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TNTK")) {
        buff = schema.getTableTableNmToken().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SNTK")) {
        buff = schema.getTableSchemaNmToken().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("NMS")) {
        buff = schema.getTableNmTokensDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TNTS")) {
        buff = schema.getTableTableNmTokens().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SNTS")) {
        buff = schema.getTableSchemaNmTokens().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("STR")) {
        buff = schema.getTableStringDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TSTR")) {
        buff = schema.getTableTableString().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SSTR")) {
        buff = schema.getTableSchemaString().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("ZDY")) {
        buff = schema.getTableTZDateDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TZDY")) {
        buff = schema.getTableTableTZDate().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SZDY")) {
        buff = schema.getTableSchemaTZDate().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("ZTM")) {
        buff = schema.getTableTZTimeDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TZTM")) {
        buff = schema.getTableTableTZTime().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SZTM")) {
        buff = schema.getTableSchemaTZTime().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("ZSP")) {
        buff = schema.getTableTZTimestampDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TZST")) {
        buff = schema.getTableTableTZTimestamp().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("SZST")) {
        buff = schema.getTableSchemaTZTimestamp().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TXT")) {
        buff = schema.getTableTextDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TTXT")) {
        buff = schema.getTableTableText().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("STXT")) {
        buff = schema.getTableSchemaText().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TIM")) {
        buff = schema.getTableTimeDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TTIM")) {
        buff = schema.getTableTableTime().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("STIM")) {
        buff = schema.getTableSchemaTime().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TSP")) {
        buff = schema.getTableTimestampDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TTSM")) {
        buff = schema.getTableTableTimestamp().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("STSM")) {
        buff = schema.getTableSchemaTimestamp().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TKN")) {
        buff = schema.getTableTokenDef().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TTOK")) {
        buff = schema.getTableTableToken().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("STOK")) {
        buff = schema.getTableSchemaToken().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("TBC")) {
        buff = schema.getTableTableCol().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("LIC")) {
        buff = schema.getTableLicense().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("CHN")) {
        buff = schema.getTableChain().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("RLC")) {
        buff = schema.getTableRelationCol().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("ETG")) {
        buff = schema.getTableEnumTag().readBuffByIdIdx(Authorization, Id);
    } else if (classCode.equals("IXC")) {
        buff = schema.getTableIndexCol().readBuffByIdIdx(Authorization, Id);
    } else {
        throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                "Did not expect ClassCode \"" + classCode + "\"");
    }
    return (buff);
}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8BoolDefTable.java

public MSSBamBoolDefBuff readBuff(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) {
    final String S_ProcName = "readBuff";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from   ww  w.  j  a  v  a2s . co m
    try {
        Connection cnx = schema.getCnx();
        long Id = PKey.getRequiredId();
        String sql = S_sqlSelectBoolDefBuff + "WHERE " + "anyo.Id = " + Long.toString(Id) + " ";
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        if (resultSet.next()) {
            MSSBamBoolDefBuff buff = unpackBoolDefResultSetToBuff(resultSet);
            if (resultSet.next()) {
                resultSet.last();
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-buff response, " + resultSet.getRow() + " rows selected");
            }
            return (buff);
        } else {
            return (null);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8BlobDefTable.java

public MSSBamBlobDefBuff readBuff(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) {
    final String S_ProcName = "readBuff";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*ww w. j  a  v a 2 s. co  m*/
    try {
        Connection cnx = schema.getCnx();
        long Id = PKey.getRequiredId();
        String sql = S_sqlSelectBlobDefBuff + "WHERE " + "anyo.Id = " + Long.toString(Id) + " ";
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        if (resultSet.next()) {
            MSSBamBlobDefBuff buff = unpackBlobDefResultSetToBuff(resultSet);
            if (resultSet.next()) {
                resultSet.last();
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-buff response, " + resultSet.getRow() + " rows selected");
            }
            return (buff);
        } else {
            return (null);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8BoolDefTable.java

public MSSBamBoolDefBuff[] readAllBuff(MSSBamAuthorization Authorization) {
    final String S_ProcName = "readAllBuff";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from w  w  w .  j a va 2 s .  c o m
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectBoolDefBuff + "WHERE " + "anyo.ClassCode = 'BLN' " + "ORDER BY "
                + "anyo.Id ASC";
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        List<MSSBamBoolDefBuff> buffList = new ArrayList<MSSBamBoolDefBuff>();
        while (resultSet.next()) {
            MSSBamBoolDefBuff buff = unpackBoolDefResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        return (buffList.toArray(new MSSBamBoolDefBuff[0]));
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8BoolDefTable.java

public MSSBamBoolDefBuff readBuffByIdIdx(MSSBamAuthorization Authorization, long Id) {
    final String S_ProcName = "readBuffByIdIdx";
    try {//from w ww  .ja  v  a2  s  .  c  om
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectBoolDefBuff + "WHERE " + "anyo.Id = " + Long.toString(Id) + " ";
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        if (resultSet.next()) {
            MSSBamBoolDefBuff buff = unpackBoolDefResultSetToBuff(resultSet);
            if (resultSet.next()) {
                resultSet.last();
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-buff response, " + resultSet.getRow() + " rows selected");
            }
            return (buff);
        } else {
            return (null);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8BlobDefTable.java

public MSSBamBlobDefBuff[] readAllBuff(MSSBamAuthorization Authorization) {
    final String S_ProcName = "readAllBuff";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/* w  ww  .jav  a2 s .com*/
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectBlobDefBuff + "WHERE " + "anyo.ClassCode = 'BLB' " + "ORDER BY "
                + "anyo.Id ASC";
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        List<MSSBamBlobDefBuff> buffList = new ArrayList<MSSBamBlobDefBuff>();
        while (resultSet.next()) {
            MSSBamBlobDefBuff buff = unpackBlobDefResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        return (buffList.toArray(new MSSBamBlobDefBuff[0]));
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8BlobDefTable.java

public MSSBamBlobDefBuff readBuffByIdIdx(MSSBamAuthorization Authorization, long Id) {
    final String S_ProcName = "readBuffByIdIdx";
    try {//from   w w  w . j av a2  s .com
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectBlobDefBuff + "WHERE " + "anyo.Id = " + Long.toString(Id) + " ";
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        if (resultSet.next()) {
            MSSBamBlobDefBuff buff = unpackBlobDefResultSetToBuff(resultSet);
            if (resultSet.next()) {
                resultSet.last();
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-buff response, " + resultSet.getRow() + " rows selected");
            }
            return (buff);
        } else {
            return (null);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8BoolDefTable.java

public MSSBamBoolDefBuff[] readBuffByTenantIdx(MSSBamAuthorization Authorization, long TenantId) {
    final String S_ProcName = "readBuffByTenantIdx";
    try {//from ww w. j  a va 2s .  c om
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectBoolDefBuff + "WHERE " + "anyo.TenantId = " + Long.toString(TenantId) + " "
                + "ORDER BY " + "anyo.Id ASC";
        Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        ResultSet resultSet = stmt.executeQuery(sql);
        List<MSSBamBoolDefBuff> buffList = new ArrayList<MSSBamBoolDefBuff>();
        while (resultSet.next()) {
            MSSBamBoolDefBuff buff = unpackBoolDefResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        return (buffList.toArray(new MSSBamBoolDefBuff[0]));
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
}