本文整理汇总了Java中net.floodlightcontroller.storage.IResultSet.setString方法的典型用法代码示例。如果您正苦于以下问题:Java IResultSet.setString方法的具体用法?Java IResultSet.setString怎么用?Java IResultSet.setString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.floodlightcontroller.storage.IResultSet
的用法示例。
在下文中一共展示了IResultSet.setString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testUpdateRowsFromResultSet
import net.floodlightcontroller.storage.IResultSet; //导入方法依赖的package包/类
@Test
public void testUpdateRowsFromResultSet() {
Object[][] expectedResults = {
{"777-77-7777", "Tennis", "Borg", 60, true},
{"888-88-8888", "Tennis", "McEnroe", 60, false}
};
IPredicate predicate = new OperatorPredicate(PERSON_AGE, OperatorPredicate.Operator.GT, 50);
IResultSet resultSet = storageSource.executeQuery(PERSON_TABLE_NAME, null, predicate, null);
while (resultSet.next()) {
resultSet.setString(PERSON_FIRST_NAME, "Tennis");
resultSet.setInt(PERSON_AGE, 60);
}
resultSet.save();
resultSet.close();
resultSet = storageSource.executeQuery(PERSON_TABLE_NAME, PERSON_COLUMN_LIST, predicate, new RowOrdering(PERSON_SSN));
checkExpectedResults(resultSet, PERSON_COLUMN_LIST, expectedResults);
}
示例2: testAsyncSave
import net.floodlightcontroller.storage.IResultSet; //导入方法依赖的package包/类
@Test
public void testAsyncSave() {
// Get a result set and make some changes to it
IResultSet resultSet = storageSource.executeQuery(PERSON_TABLE_NAME, null, null, new RowOrdering(PERSON_SSN));
resultSet.next();
resultSet.deleteRow();
resultSet.next();
resultSet.setString(PERSON_FIRST_NAME, "John");
Future<?> future = storageSource.saveAsync(resultSet);
waitForFuture(future);
try {
resultSet = storageSource.executeQuery(PERSON_TABLE_NAME, null, null, new RowOrdering(PERSON_SSN));
Object[][] expectedPersons = Arrays.copyOfRange(PERSON_INIT_DATA, 1, PERSON_INIT_DATA.length);
expectedPersons[0][1] = "John";
checkExpectedResults(resultSet, PERSON_COLUMN_LIST, expectedPersons);
}
catch (Exception e) {
fail("Exception thrown in async storage operation: " + e.toString());
}
}