本文整理汇总了Java中javax.sql.rowset.CachedRowSet.close方法的典型用法代码示例。如果您正苦于以下问题:Java CachedRowSet.close方法的具体用法?Java CachedRowSet.close怎么用?Java CachedRowSet.close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sql.rowset.CachedRowSet
的用法示例。
在下文中一共展示了CachedRowSet.close方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: commonCachedRowSetTest0058
import javax.sql.rowset.CachedRowSet; //导入方法依赖的package包/类
@Test(dataProvider = "rowsetUsingCoffeeHouses")
public void commonCachedRowSetTest0058(CachedRowSet rs) throws Exception {
int rowToInsert = 1961;
assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
try ( // Add new row
CachedRowSet crs1 = rsf.createCachedRowSet()) {
rs.beforeFirst();
crs1.populate(rs);
TestRowSetListener rsl = new TestRowSetListener();
crs1.addRowSetListener(rsl);
crs1.moveToInsertRow();
crs1.updateInt(1, rowToInsert);
crs1.updateString(2, "GOTHAM");
crs1.updateInt(3, 3450);
crs1.updateInt(4, 2005);
crs1.updateInt(5, 5455);
crs1.insertRow();
assertTrue(rsl.isNotified(TestRowSetListener.ROW_CHANGED));
crs1.moveToCurrentRow();
assertTrue(findRowByPrimaryKey(crs1, rowToInsert, 1));
// Restore back to our original state and the
// previously inserted row should not be there
rsl.resetFlag();
crs1.restoreOriginal();
assertTrue(rsl.isNotified(TestRowSetListener.ROWSET_CHANGED));
assertTrue(crs1.isBeforeFirst());
crs1.last();
assertFalse(crs1.rowInserted());
assertFalse(findRowByPrimaryKey(crs1, rowToInsert, 1));
}
rs.close();
}
示例2: commonCachedRowSetTest0045
import javax.sql.rowset.CachedRowSet; //导入方法依赖的package包/类
@Test(dataProvider = "rowsetUsingCoffeeHouses",
expectedExceptions = SQLException.class)
public void commonCachedRowSetTest0045(CachedRowSet rs) throws Exception {
rs.setShowDeleted(true);
rs.beforeFirst();
rs.undoDelete();
rs.close();
}
示例3: joinRowSetTests0006
import javax.sql.rowset.CachedRowSet; //导入方法依赖的package包/类
@Test(dataProvider = "createCachedRowSetsToUse")
public void joinRowSetTests0006(CachedRowSet crs, CachedRowSet crs1)
throws Exception {
try (JoinRowSet jrs = newInstance()) {
crs.setMatchColumn(COFFEES_JOIN_COLUMN_INDEX);
crs1.setMatchColumn(SUPPLIERS_JOIN_COLUMN_INDEX);
jrs.addRowSet(crs);
jrs.addRowSet(crs1);
validateResults(jrs);
crs.close();
crs1.close();
}
}
示例4: joinRowSetTests0005
import javax.sql.rowset.CachedRowSet; //导入方法依赖的package包/类
@Test(dataProvider = "createCachedRowSetsToUse")
public void joinRowSetTests0005(CachedRowSet crs, CachedRowSet crs1)
throws Exception {
try (JoinRowSet jrs = newInstance()) {
crs.setMatchColumn(JOIN_COLNAME);
crs1.setMatchColumn(JOIN_COLNAME);
jrs.addRowSet(crs);
jrs.addRowSet(crs1);
validateResults(jrs);
crs.close();
crs1.close();
}
}
示例5: commonCachedRowSetTest0048
import javax.sql.rowset.CachedRowSet; //导入方法依赖的package包/类
@Test(dataProvider = "rowsetUsingCoffeeHouses",
expectedExceptions = SQLException.class)
public void commonCachedRowSetTest0048(CachedRowSet rs) throws Exception {
rs.setShowDeleted(true);
rs.beforeFirst();
rs.undoUpdate();
rs.close();
}
示例6: commonCachedRowSetTest0034
import javax.sql.rowset.CachedRowSet; //导入方法依赖的package包/类
@Test(dataProvider = "rowsetUsingCoffeeHouses")
public void commonCachedRowSetTest0034(CachedRowSet rs) throws Exception {
Object[] cities = {"Mendocino", "Seattle", "SF", "Portland", "SF",
"Sacramento", "Carmel", "LA", "Olympia", "Seattle", "SF",
"LA", "San Jose", "Eugene"};
rs.beforeFirst();
assertEquals(rs.toCollection(2).toArray(), cities);
assertEquals(rs.toCollection("CITY").toArray(), cities);
rs.close();
}
示例7: joinRowSetTests0001
import javax.sql.rowset.CachedRowSet; //导入方法依赖的package包/类
@Test(dataProvider = "createCachedRowSetsToUse")
public void joinRowSetTests0001(CachedRowSet crs, CachedRowSet crs1)
throws Exception {
try (JoinRowSet jrs = newInstance()) {
jrs.addRowSet(crs, COFFEES_JOIN_COLUMN_INDEX);
jrs.addRowSet(crs1, SUPPLIERS_JOIN_COLUMN_INDEX);
validateResults(jrs);
crs.close();
crs1.close();
}
}
示例8: commonCachedRowSetTest0054
import javax.sql.rowset.CachedRowSet; //导入方法依赖的package包/类
@Test(dataProvider = "rowsetUsingCoffeeHouses")
public void commonCachedRowSetTest0054(CachedRowSet rs) throws Exception {
int rowToDelete = 1961;
assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
// Add new row
rs.moveToInsertRow();
rs.updateInt(1, rowToDelete);
rs.updateString(2, "GOTHAM");
rs.updateInt(3, 3450);
rs.updateInt(4, 2005);
rs.updateInt(5, 5455);
rs.insertRow();
rs.moveToCurrentRow();
// check that the number of rows has increased
assertTrue(rs.size() == COFFEE_HOUSES_ROWS + 1);
assertTrue(findRowByPrimaryKey(rs, rowToDelete, 1));
rs.absolute(COFFEE_HOUSES_ROWS + 1);
rs.deleteRow();
// Check to make sure the row is no longer there
//assertTrue(rs.size() == COFFEE_HOUSES_ROWS);
assertFalse(findRowByPrimaryKey(rs, rowToDelete, 1));
rs.setShowDeleted(true);
rs.absolute(COFFEE_HOUSES_ROWS + 1);
rs.undoDelete();
// check that the row is back
assertTrue(rs.size() == COFFEE_HOUSES_ROWS + 1);
assertTrue(findRowByPrimaryKey(rs, rowToDelete, 1));
rs.close();
}
示例9: joinRowSetTests0002
import javax.sql.rowset.CachedRowSet; //导入方法依赖的package包/类
@Test(dataProvider = "createCachedRowSetsToUse")
public void joinRowSetTests0002(CachedRowSet crs, CachedRowSet crs1)
throws Exception {
try (JoinRowSet jrs = newInstance()) {
RowSet[] rowsets = {crs, crs1};
String[] joinCols = {JOIN_COLNAME, JOIN_COLNAME};
jrs.addRowSet(rowsets, joinCols);
validateResults(jrs);
crs.close();
crs1.close();
}
}
示例10: commonCachedRowSetTest0046
import javax.sql.rowset.CachedRowSet; //导入方法依赖的package包/类
@Test(dataProvider = "rowsetUsingCoffeeHouses",
expectedExceptions = SQLException.class)
public void commonCachedRowSetTest0046(CachedRowSet rs) throws Exception {
rs.setShowDeleted(true);
rs.afterLast();
rs.undoDelete();
rs.close();
}
示例11: commonCachedRowSetTest0018
import javax.sql.rowset.CachedRowSet; //导入方法依赖的package包/类
@Test(dataProvider = "rowsetUsingCoffeeHouses", enabled = false)
public void commonCachedRowSetTest0018(CachedRowSet rs) throws Exception {
int[] expectedCols = {1, 3};
String[] expectedColNames = {"COF_ID", "SUP_ID"};
rs.setMatchColumn(expectedCols);
int[] actualCols = rs.getMatchColumnIndexes();
String[] actualColNames = rs.getMatchColumnNames();
assertEquals(actualCols, expectedCols);
assertEquals(actualColNames, expectedColNames);
assertEquals(actualCols, expectedCols);
rs.close();
}
示例12: commonCachedRowSetTest0044
import javax.sql.rowset.CachedRowSet; //导入方法依赖的package包/类
@Test(dataProvider = "rowsetUsingCoffeeHouses",
expectedExceptions = SQLException.class)
public void commonCachedRowSetTest0044(CachedRowSet rs) throws Exception {
rs.insertRow();
rs.undoDelete();
rs.close();
}
示例13: commonCachedRowSetTest0061
import javax.sql.rowset.CachedRowSet; //导入方法依赖的package包/类
@Test(dataProvider = "rowsetUsingCoffeeHouses")
public void commonCachedRowSetTest0061(CachedRowSet rs) throws Exception {
try (CachedRowSet crs1 = rsf.createCachedRowSet()) {
rs.beforeFirst();
crs1.populate(rs);
compareRowSets(rs, crs1);
}
rs.close();
}
示例14: joinRowSetTests0003
import javax.sql.rowset.CachedRowSet; //导入方法依赖的package包/类
@Test(dataProvider = "createCachedRowSetsToUse")
public void joinRowSetTests0003(CachedRowSet crs, CachedRowSet crs1)
throws Exception {
try (JoinRowSet jrs = newInstance()) {
RowSet[] rowsets = {crs, crs1};
int[] joinCols = {COFFEES_JOIN_COLUMN_INDEX,
SUPPLIERS_JOIN_COLUMN_INDEX};
jrs.addRowSet(rowsets, joinCols);
validateResults(jrs);
crs.close();
crs1.close();
}
}
示例15: commonCachedRowSetTest0001
import javax.sql.rowset.CachedRowSet; //导入方法依赖的package包/类
@Test(dataProvider = "rowSetType", expectedExceptions = SyncProviderException.class)
public void commonCachedRowSetTest0001(CachedRowSet rs) throws Exception {
rs.acceptChanges(null);
rs.close();
}