本文整理汇总了Java中javax.sql.RowSetEvent类的典型用法代码示例。如果您正苦于以下问题:Java RowSetEvent类的具体用法?Java RowSetEvent怎么用?Java RowSetEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RowSetEvent类属于javax.sql包,在下文中一共展示了RowSetEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testConstructor
import javax.sql.RowSetEvent; //导入依赖的package包/类
/**
* @tests {@link javax.sql.RowSetEvent#RowSetEvent(javax.sql.RowSet)}.
*/
@TestTargetNew(
level = TestLevel.SUFFICIENT,
notes = "functional test missing but not feasible: no implementation available.",
method = "RowSetEvent",
args = {javax.sql.RowSet.class}
)
public void testConstructor() {
try {
new RowSetEvent(null);
fail("illegal argument exception expected");
} catch (IllegalArgumentException e) {
}
Impl_RowSet irs = new Impl_RowSet();
RowSetEvent rse = new RowSetEvent(irs);
assertSame(irs, rse.getSource());
}
示例2: rowSetPopulated
import javax.sql.RowSetEvent; //导入依赖的package包/类
public void rowSetPopulated(RowSetEvent event, int numRows)
throws SQLException {
if (numRows <= 0) {
// sql.42=Illegal Argument
throw new SQLException(Messages.getString("sql.42")); //$NON-NLS-1$
}
if (numRows < getFetchSize()) {
// rowset.22=Number of rows is less than fetch size
throw new SQLException(Messages.getString("rowset.22")); //$NON-NLS-1$
}
if (size() == 0 || size() % numRows == 0) {
if (isNotifyListener) {
notifyRowSetChanged();
}
}
}
示例3: testRowSetPopulated_Three
import javax.sql.RowSetEvent; //导入依赖的package包/类
public void testRowSetPopulated_Three() throws Exception {
noInitialCrset = newNoInitialInstance();
Listener listener = new Listener();
noInitialCrset.addRowSetListener(listener);
noInitialCrset.setMaxRows(10);
noInitialCrset.setFetchSize(4);
try {
noInitialCrset.rowSetPopulated(new RowSetEvent(crset), 3);
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
listener.clear();
noInitialCrset.rowSetPopulated(new RowSetEvent(crset), 4);
assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
for (int i = 5; i <= 30; i++) {
listener.clear();
noInitialCrset.rowSetPopulated(new RowSetEvent(crset), i);
assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
}
}
示例4: rowChanged
import javax.sql.RowSetEvent; //导入依赖的package包/类
public void rowChanged(RowSetEvent event) {
try {
int row = rowSet.getRow();
if (rowSet.rowDeleted()) {
fireTableRowsDeleted(row, row);
} else if (rowSet.rowInserted()) {
fireTableRowsInserted(row, row);
} else if (rowSet.rowUpdated()) {
fireTableRowsUpdated(row, row);
}
} catch (SQLException e) {
}
}
示例5: testCursorMoved
import javax.sql.RowSetEvent; //导入依赖的package包/类
/**
* Test method for {@link javax.sql.RowSetListener#cursorMoved(javax.sql.RowSetEvent)}.
*/
@TestTargetNew(
level = TestLevel.NOT_FEASIBLE,
notes = "",
method = "cursorMoved",
args = {javax.sql.RowSetEvent.class}
)
public void testCursorMoved() {
fail("Not yet implemented");
}
示例6: testRowChanged
import javax.sql.RowSetEvent; //导入依赖的package包/类
/**
* Test method for {@link javax.sql.RowSetListener#rowChanged(javax.sql.RowSetEvent)}.
*/
@TestTargetNew(
level = TestLevel.NOT_FEASIBLE,
notes = "",
method = "rowChanged",
args = {javax.sql.RowSetEvent.class}
)
public void testRowChanged() {
fail("Not yet implemented");
}
示例7: testRowSetChanged
import javax.sql.RowSetEvent; //导入依赖的package包/类
/**
* Test method for {@link javax.sql.RowSetListener#rowSetChanged(javax.sql.RowSetEvent)}.
*/
@TestTargetNew(
level = TestLevel.NOT_FEASIBLE,
notes = "",
method = "rowSetChanged",
args = {javax.sql.RowSetEvent.class}
)
public void testRowSetChanged() {
fail("Not yet implemented");
}
示例8: notifyCursorMoved
import javax.sql.RowSetEvent; //导入依赖的package包/类
protected void notifyCursorMoved() throws SQLException {
if (!(this instanceof RowSet)) {
throw new SQLException();
}
if (listeners.isEmpty()) {
return;
}
for (RowSetListener listener : listeners) {
listener.cursorMoved(new RowSetEvent((RowSet) this));
}
}
示例9: notifyRowChanged
import javax.sql.RowSetEvent; //导入依赖的package包/类
protected void notifyRowChanged() throws SQLException {
if (!(this instanceof RowSet)) {
throw new SQLException();
}
if (listeners.isEmpty()) {
return;
}
for (RowSetListener listener : listeners) {
listener.rowChanged(new RowSetEvent((RowSet) this));
}
}
示例10: notifyRowSetChanged
import javax.sql.RowSetEvent; //导入依赖的package包/类
protected void notifyRowSetChanged() throws SQLException {
if (!(this instanceof RowSet)) {
throw new SQLException();
}
if (listeners.isEmpty()) {
return;
}
for (RowSetListener listener : listeners) {
listener.rowSetChanged(new RowSetEvent((RowSet) this));
}
}
示例11: testConstructor
import javax.sql.RowSetEvent; //导入依赖的package包/类
public void testConstructor() {
try {
new RowSetEvent(null);
fail("illegal argument exception expected");
} catch (IllegalArgumentException e) {
}
Impl_RowSet irs = new Impl_RowSet();
RowSetEvent rse = new RowSetEvent(irs);
assertSame(irs, rse.getSource());
}
示例12: testRowSetPopulated_One
import javax.sql.RowSetEvent; //导入依赖的package包/类
public void testRowSetPopulated_One() throws Exception {
/*
* There are 24 rows in database.
*/
insertMoreData(20);
noInitialCrset = newNoInitialInstance();
Listener listener = new Listener();
noInitialCrset.addRowSetListener(listener);
assertEquals(0, noInitialCrset.getFetchSize());
noInitialCrset.setMaxRows(10);
noInitialCrset.setFetchSize(3);
rs = st.executeQuery("SELECT * FROM USER_INFO");
noInitialCrset.populate(rs);
listener.clear();
noInitialCrset.rowSetPopulated(new RowSetEvent(noInitialCrset), 3);
assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
listener.clear();
noInitialCrset.rowSetPopulated(new RowSetEvent(noInitialCrset), 4);
assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
listener.clear();
noInitialCrset.rowSetPopulated(new RowSetEvent(noInitialCrset), 6);
assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
listener.clear();
noInitialCrset.rowSetPopulated(new RowSetEvent(noInitialCrset), 8);
assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
listener.clear();
noInitialCrset.rowSetPopulated(new RowSetEvent(noInitialCrset), 12);
assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
listener.clear();
noInitialCrset.rowSetPopulated(new RowSetEvent(noInitialCrset), 24);
assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
}
示例13: rowSetChanged
import javax.sql.RowSetEvent; //导入依赖的package包/类
public void rowSetChanged(RowSetEvent theEvent) {
if (isPrint) {
System.out.println("rowSetChanged");
}
tag = CachedRowSetListenerTest.EVENT_ROWSET_CHANGED;
eventSource = theEvent.getSource();
}
示例14: testConstructor
import javax.sql.RowSetEvent; //导入依赖的package包/类
public void testConstructor() {
try {
new RowSetEvent(null);
fail("illegal argument exception expected");
} catch (IllegalArgumentException e) {
}
Impl_RowSet irs = new Impl_RowSet();
RowSetEvent rse = new RowSetEvent(irs);
assertSame(irs, rse.getSource());
}
示例15: rowSetPopulated
import javax.sql.RowSetEvent; //导入依赖的package包/类
@Override
public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
throw new UnsupportedOperationException("Not supported yet.");
}