List of usage examples for java.sql ResultSet CONCUR_READ_ONLY
int CONCUR_READ_ONLY
To view the source code for java.sql ResultSet CONCUR_READ_ONLY.
Click Source Link
ResultSet
object that may NOT be updated. From source file:edu.ku.brc.specify.conversion.BasicSQLUtils.java
/** * Returns a count of the records query by SQL passed in. * @param sql the SQL with a 'count(?)' * @return the number of records or zero *///from w ww . jav a 2 s . c o m public static int getNumRecords(final String sql, final Connection conn) { Statement cntStmt = null; try { int count = 0; if (conn != null) { cntStmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); if (cntStmt != null) { ResultSet rs = cntStmt.executeQuery(sql); if (rs.first()) { count = rs.getInt(1); } rs.close(); } cntStmt.close(); } return count; } catch (SQLException ex) { edu.ku.brc.af.core.UsageTracker.incrSQLUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(BasicSQLUtils.class, ex); log.error(ex); } finally { try { if (cntStmt != null) { cntStmt.close(); } } catch (SQLException ex) { ex.printStackTrace(); } } return 0; }
From source file:edu.ku.brc.specify.conversion.BasicSQLUtils.java
/** * Returns the last ID that was inserted into the database * @param connection db connection//from w w w. j a va 2 s.co m * @param tableName the name of the table * @param idColName primary key column name * @return the last ID that was inserted into the database */ public static int getHighestId(final Connection connection, final String idColName, final String tableName) { try { Statement cntStmt = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); ResultSet rs = cntStmt .executeQuery("select " + idColName + " from " + tableName + " order by " + idColName + " asc"); int id = 0; if (rs.last()) { id = rs.getInt(1); } else { id = 1; } rs.close(); cntStmt.close(); return id; } catch (SQLException ex) { edu.ku.brc.af.core.UsageTracker.incrSQLUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(BasicSQLUtils.class, ex); log.error(ex); } return -1; }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8AtomDefTable.java
public MSSBamAtomDefBuff[] readDerivedByScopeIdx(MSSBamAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readDerivedByScopeIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//from w ww . j ava2 s . c o m ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; try { Connection cnx = schema.getCnx(); String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE " + ((ScopeId == null) ? "anyo.ScopeId is null " : "anyo.ScopeId = " + ScopeId.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<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("ATM")) { MSSBamAtomDefBuff[] subList = readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("BLB")) { MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TBLB")) { MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SBLB")) { MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("BLN")) { MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TBLN")) { MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SBLN")) { MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("DAT")) { MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TDAT")) { MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SDAT")) { MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("DBL")) { MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TDBL")) { MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SDBL")) { MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("NUM")) { MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TNUM")) { MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SNUM")) { MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("FLT")) { MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TFLT")) { MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SFLT")) { MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("I16")) { MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TI16")) { MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SI16")) { MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("ENM")) { MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TENM")) { MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SENM")) { MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("G16")) { MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TG16")) { MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SG16")) { MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("U16")) { MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TU16")) { MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SU16")) { MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("I32")) { MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TI32")) { MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SI32")) { MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("G32")) { MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TG32")) { MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SG32")) { MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("U32")) { MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TU32")) { MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SU32")) { MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("I64")) { MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TI64")) { MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SI64")) { MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("G64")) { MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TG64")) { MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SG64")) { MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("U64")) { MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TU64")) { MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SU64")) { MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("UUID")) { MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TUUI")) { MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SUUI")) { MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("IDGU")) { MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TGUU")) { MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SGUU")) { MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("NMT")) { MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TNTK")) { MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SNTK")) { MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("NMS")) { MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TNTS")) { MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SNTS")) { MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens() .readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("STR")) { MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TSTR")) { MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SSTR")) { MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("ZDY")) { MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TZDY")) { MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SZDY")) { MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("ZTM")) { MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TZTM")) { MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SZTM")) { MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("ZSP")) { MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef() .readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TZST")) { MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp() .readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SZST")) { MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp() .readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TXT")) { MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TTXT")) { MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("STXT")) { MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TIM")) { MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TTIM")) { MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("STIM")) { MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TSP")) { MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TTSM")) { MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp() .readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("STSM")) { MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp() .readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TKN")) { MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TTOK")) { MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("STOK")) { MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByScopeIdx(Authorization, ScopeId); 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 MSSBamAtomDefBuff[0])); }
From source file:edu.ku.brc.specify.conversion.BasicSQLUtils.java
/** * @param connection//from ww w . j a v a 2s .co m * @param tableName * @param mySwitch * @param currentServerType */ public static void setIdentityInserCommandForSQLServer(final Connection connection, final String tableName, final String mySwitch, final SERVERTYPE currentServerType) { //REQUIRED FOR SQL SERVER IN ORDER TO PROGRAMMATICALLY SET DEFAULT VALUES if (currentServerType == SERVERTYPE.MS_SQLServer) { try { Statement cntStmt = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); String str = "SET IDENTITY_INSERT " + tableName + " " + mySwitch; cntStmt.execute(str); str = "SET QUOTED_IDENTIFIER OFF"; cntStmt.execute(str); cntStmt.close(); } catch (SQLException ex) { edu.ku.brc.af.core.UsageTracker.incrSQLUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(BasicSQLUtils.class, ex); log.error(ex); ex.printStackTrace(); System.exit(0); } } }
From source file:edu.ku.brc.specify.conversion.ConvertVerifier.java
/** * /* w w w. j a va2s . co m*/ */ private void verifyAgents() { try { Statement stmt = oldDBConn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); ResultSet rs = stmt.executeQuery("SELECT OldID, NewID FROM agent_AgentID"); while (rs.next()) { int oldId = rs.getInt(1); int newId = rs.getInt(2); newSQL = "SELECT a.AgentType, a.LastName, a.MiddleInitial, a.FirstName, " + "adr.Phone1, adr.Phone2, adr.Address, adr.City, adr.State, adr.PostalCode, adr.Country " + "FROM agent AS a Left Join address AS adr ON a.AgentID = adr.AgentID WHERE a.AgentID = " + newId + " ORDER BY adr.Phone1, adr.Address, adr.City, adr.State, adr.PostalCode"; oldSQL = "SELECT a.AgentType, IF (a.LastName IS null OR LENGTH(a.LastName) = 0, a.Name, a.LastName), a.MiddleInitial, a.FirstName," + "aa.Phone1, aa.Phone2 ,adr.Address, adr.City, adr.State ,adr.Postalcode, adr.Country FROM agent AS a " + "Left Join agentaddress AS aa ON a.AgentID = aa.AgentID " + "Left Join address AS adr ON aa.AddressID = adr.AddressID WHERE a.AgentID = " + oldId + " ORDER BY aa.Phone1, adr.Address, adr.City, adr.State ,adr.Postalcode"; //log.info(newSQL); //log.info(oldSQL); getResultSets(oldSQL, newSQL); while (true) { boolean hasOldRec = oldDBRS.next(); boolean hasNewRec = newDBRS.next(); if (!hasOldRec || !hasNewRec) { break; } for (int i = 1; i <= newDBRS.getMetaData().getColumnCount(); i++) { String newStr = newDBRS.getString(i); String oldStr = oldDBRS.getString(i); if (!compareStr(oldStr, newStr)) { String fldName = newDBRS.getMetaData().getColumnName(i); String oldNewIdStr = oldId + " / " + newId; String msg = " Fields " + fldName + " don't match. [" + oldStr + "][" + newStr + "]"; tblWriter.logErrors(oldNewIdStr, msg); log.error(oldNewIdStr + msg); } } } } rs.close(); stmt.close(); oldDBRS.close(); newDBRS.close(); } catch (Exception ex) { ex.printStackTrace(); } }
From source file:edu.ku.brc.specify.conversion.BasicSQLUtils.java
public static void removeForeignKeyConstraints(final Connection connection, final String tableName, final SERVERTYPE currentServerType) { try {// ww w. j ava2 s. c o m if (currentServerType == SERVERTYPE.MS_SQLServer) { Statement cntStmt = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); String str = "ALTER TABLE " + tableName + " NOCHECK CONSTRAINT ALL"; cntStmt.execute(str); cntStmt.close(); } else { Statement cntStmt = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); String str = "SET FOREIGN_KEY_CHECKS = 0"; cntStmt.execute(str); cntStmt.close(); } } catch (SQLException ex) { edu.ku.brc.af.core.UsageTracker.incrSQLUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(BasicSQLUtils.class, ex); log.error("Error encountered trying to turn off foreign key constraints on database"); log.error(ex); } }
From source file:edu.ku.brc.specify.conversion.BasicSQLUtils.java
/** * @param connection//from w w w . j a v a2s .c om * @param currentServerType */ public static void removeForeignKeyConstraints(final Connection connection, final SERVERTYPE currentServerType) { try { if (currentServerType == SERVERTYPE.MS_SQLServer) { List<String> myTables = getTableNames(connection); for (Iterator<String> i = myTables.iterator(); i.hasNext();) { String s = i.next(); Statement cntStmt = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); String str = "ALTER TABLE " + s + " NOCHECK CONSTRAINT ALL"; cntStmt.execute(str); cntStmt.close(); } } else { Statement cntStmt = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); String str = "SET FOREIGN_KEY_CHECKS = 0"; cntStmt.execute(str); cntStmt.close(); } } catch (SQLException ex) { edu.ku.brc.af.core.UsageTracker.incrSQLUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(BasicSQLUtils.class, ex); log.error(ex); } }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8AnyObjTable.java
public MSSBamAnyObjBuff[] readDerivedByScopeIdx(MSSBamAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readDerivedByScopeIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*from w w w . j a va 2s . c om*/ ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; try { Connection cnx = schema.getCnx(); String sql = S_sqlSelectAnyObjDistinctClassCode + "WHERE " + ((ScopeId == null) ? "anyo.ScopeId is null " : "anyo.ScopeId = " + ScopeId.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<MSSBamAnyObjBuff> resultList = new ArrayList<MSSBamAnyObjBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("ANYO")) { MSSBamAnyObjBuff[] subList = readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SCP")) { MSSBamScopeBuff[] subList = schema.getTableScope().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("DICT")) { MSSBamDictionaryBuff[] subList = schema.getTableDictionary().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("RMD")) { MSSBamMSSBamBuff[] subList = schema.getTableMSSBam().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("BDM")) { MSSBamBaseDomainBuff[] subList = schema.getTableBaseDomain().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("DOM")) { MSSBamDomainBuff[] subList = schema.getTableDomain().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("LENT")) { MSSBamLegalEntityBuff[] subList = schema.getTableLegalEntity().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("COM")) { MSSBamCompanyBuff[] subList = schema.getTableCompany().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("USR")) { MSSBamUserBuff[] subList = schema.getTableUser().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("PRJ")) { MSSBamProjectBuff[] subList = schema.getTableProject().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("VER")) { MSSBamVersionBuff[] subList = schema.getTableVersion().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("MJV")) { MSSBamMajorVersionBuff[] subList = schema.getTableMajorVersion().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("MNV")) { MSSBamMinorVersionBuff[] subList = schema.getTableMinorVersion().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TLD")) { MSSBamTLDBuff[] subList = schema.getTableTLD().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("IDX")) { MSSBamIndexBuff[] subList = schema.getTableIndex().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("REL")) { MSSBamRelationBuff[] subList = schema.getTableRelation().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SCH")) { MSSBamSchemaDefBuff[] subList = schema.getTableSchemaDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TBL")) { MSSBamTableBuff[] subList = schema.getTableTable().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("VAL")) { MSSBamValueBuff[] subList = schema.getTableValue().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("ATM")) { MSSBamAtomDefBuff[] subList = schema.getTableAtomDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("BLB")) { MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TBLB")) { MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SBLB")) { MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("BLN")) { MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TBLN")) { MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SBLN")) { MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("DAT")) { MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TDAT")) { MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SDAT")) { MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("DBL")) { MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TDBL")) { MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SDBL")) { MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("NUM")) { MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TNUM")) { MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SNUM")) { MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("FLT")) { MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TFLT")) { MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SFLT")) { MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("I16")) { MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TI16")) { MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SI16")) { MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("ENM")) { MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TENM")) { MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SENM")) { MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("G16")) { MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TG16")) { MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SG16")) { MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("U16")) { MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TU16")) { MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SU16")) { MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("I32")) { MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TI32")) { MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SI32")) { MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("G32")) { MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TG32")) { MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SG32")) { MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("U32")) { MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TU32")) { MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SU32")) { MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("I64")) { MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TI64")) { MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SI64")) { MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("G64")) { MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TG64")) { MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SG64")) { MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("U64")) { MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TU64")) { MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SU64")) { MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("UUID")) { MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TUUI")) { MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SUUI")) { MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("IDGU")) { MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TGUU")) { MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SGUU")) { MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("NMT")) { MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TNTK")) { MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SNTK")) { MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("NMS")) { MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TNTS")) { MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SNTS")) { MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens() .readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("STR")) { MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TSTR")) { MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SSTR")) { MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("ZDY")) { MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TZDY")) { MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SZDY")) { MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("ZTM")) { MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TZTM")) { MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SZTM")) { MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("ZSP")) { MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef() .readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TZST")) { MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp() .readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SZST")) { MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp() .readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TXT")) { MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TTXT")) { MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("STXT")) { MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TIM")) { MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TTIM")) { MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("STIM")) { MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TSP")) { MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TTSM")) { MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp() .readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("STSM")) { MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp() .readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TKN")) { MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TTOK")) { MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("STOK")) { MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TBC")) { MSSBamTableColBuff[] subList = schema.getTableTableCol().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("LIC")) { MSSBamLicenseBuff[] subList = schema.getTableLicense().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CHN")) { MSSBamChainBuff[] subList = schema.getTableChain().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("RLC")) { MSSBamRelationColBuff[] subList = schema.getTableRelationCol().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("ETG")) { MSSBamEnumTagBuff[] subList = schema.getTableEnumTag().readBuffByScopeIdx(Authorization, ScopeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("IXC")) { MSSBamIndexColBuff[] subList = schema.getTableIndexCol().readBuffByScopeIdx(Authorization, ScopeId); 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 MSSBamAnyObjBuff[0])); }
From source file:ProcessRequest.java
public ResultSet executeQuery(String query) { Connection conn = null;/* w w w. j ava 2 s . c o m*/ Statement stmt = null; ResultSet rs = null; System.out.println("query: " + query); try { Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); if (mSQLPort != null && mSQLHost != null && mDbName != null && mDbPass != null && mDbUser != null && !mSQLPort.equals("") && !mSQLHost.equals("") && !mDbName.equals("") && !mDbPass.equals("") && !mDbUser.equals("")) { conn = DriverManager.getConnection("jdbc:sqlserver://" + mSQLHost + ":" + mSQLPort + ";databaseName=" + mDbName + ";user=" + mDbUser + ";password=" + mDbPass + ";"); //System.out.println("DB connect: jdbc:sqlserver://"+mSQLHost+":"+mSQLPort+";databaseName=TMSV73;user=sa;password=keith;"); } else { throw new IllegalArgumentException( "config file error. something was missing and a default value wasn't used. this is a programmer error. please contact support."); } stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); rs = stmt.executeQuery(query); //NOTE: if we close this immediately, we will lose the ResultSet. the Statement will close itself anyway // after the garbage collector notices it has no references. //stmt.close(); } catch (Exception e) { System.out.println(e.toString()); e.printStackTrace(); return null; } return rs; }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8AtomDefTable.java
public MSSBamAtomDefBuff[] readDerivedByAuthorIdx(MSSBamAuthorization Authorization, Long AuthorId) { final String S_ProcName = "readDerivedByAuthorIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }// w ww . ja v a2s. c o m ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; try { Connection cnx = schema.getCnx(); String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE " + ((AuthorId == null) ? "anyo.AuthorId is null " : "anyo.AuthorId = " + AuthorId.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<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("ATM")) { MSSBamAtomDefBuff[] subList = readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("BLB")) { MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TBLB")) { MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SBLB")) { MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("BLN")) { MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TBLN")) { MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SBLN")) { MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("DAT")) { MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TDAT")) { MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SDAT")) { MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("DBL")) { MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TDBL")) { MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SDBL")) { MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("NUM")) { MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TNUM")) { MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SNUM")) { MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("FLT")) { MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TFLT")) { MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SFLT")) { MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("I16")) { MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TI16")) { MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SI16")) { MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("ENM")) { MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TENM")) { MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SENM")) { MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("G16")) { MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TG16")) { MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SG16")) { MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen() .readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("U16")) { MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TU16")) { MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SU16")) { MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("I32")) { MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TI32")) { MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SI32")) { MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("G32")) { MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TG32")) { MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SG32")) { MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen() .readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("U32")) { MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TU32")) { MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SU32")) { MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("I64")) { MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TI64")) { MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SI64")) { MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("G64")) { MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TG64")) { MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SG64")) { MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen() .readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("U64")) { MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TU64")) { MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SU64")) { MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("UUID")) { MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TUUI")) { MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SUUI")) { MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("IDGU")) { MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TGUU")) { MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SGUU")) { MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen() .readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("NMT")) { MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TNTK")) { MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SNTK")) { MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken() .readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("NMS")) { MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TNTS")) { MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens() .readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SNTS")) { MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens() .readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("STR")) { MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TSTR")) { MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SSTR")) { MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("ZDY")) { MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TZDY")) { MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SZDY")) { MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("ZTM")) { MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TZTM")) { MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SZTM")) { MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("ZSP")) { MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef() .readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TZST")) { MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp() .readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SZST")) { MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp() .readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TXT")) { MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TTXT")) { MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("STXT")) { MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TIM")) { MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TTIM")) { MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("STIM")) { MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TSP")) { MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TTSM")) { MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp() .readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("STSM")) { MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp() .readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TKN")) { MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TTOK")) { MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByAuthorIdx(Authorization, AuthorId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("STOK")) { MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByAuthorIdx(Authorization, AuthorId); 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 MSSBamAtomDefBuff[0])); }