use of org.apache.derby.iapi.types.BooleanDataValue in project derby by apache.
the class UpdateResultSet method foundRow.
public static boolean foundRow(ExecRow checkRow, int[] colsToCheck, TemporaryRowHolderImpl rowHolder) throws StandardException {
ExecRow scanRow;
boolean foundMatch = false;
Object[] checkRowArray = checkRow.getRowArray();
DataValueDescriptor checkCol;
DataValueDescriptor scanCol;
CursorResultSet rs = rowHolder.getResultSet();
try {
/*
** For each inserted row
*/
rs.open();
while ((scanRow = rs.getNextRow()) != null) {
Object[] scanRowArray = scanRow.getRowArray();
int i;
for (i = 0; i < colsToCheck.length; i++) {
checkCol = (DataValueDescriptor) checkRowArray[colsToCheck[i] - 1];
scanCol = (DataValueDescriptor) scanRowArray[colsToCheck[i] - 1];
BooleanDataValue result = checkCol.equals(scanCol, // result
checkCol);
if (!result.getBoolean()) {
break;
}
}
if (i == colsToCheck.length) {
foundMatch = true;
break;
}
}
} finally {
rs.close();
}
return foundMatch;
}
Aggregations