当前位置: 首页>>代码示例>>Java>>正文


Java RowSetEvent类代码示例

本文整理汇总了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());
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:21,代码来源:RowSetEventTest.java

示例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();
        }
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:CachedRowSetImpl.java

示例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());
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:25,代码来源:CachedRowSetListenerTest.java

示例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) {
	}
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:15,代码来源:RowSetModel.java

示例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");
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:13,代码来源:RowSetListenerTest.java

示例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");
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:13,代码来源:RowSetListenerTest.java

示例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");
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:13,代码来源:RowSetListenerTest.java

示例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));
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:12,代码来源:BaseRowSet.java

示例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));
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:12,代码来源:BaseRowSet.java

示例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));
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:12,代码来源:BaseRowSet.java

示例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());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:12,代码来源:RowSetEventTest.java

示例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());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:39,代码来源:CachedRowSetListenerTest.java

示例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();
}
 
开发者ID:shannah,项目名称:cn1,代码行数:8,代码来源:CachedRowSetImplTest.java

示例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());
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:12,代码来源:RowSetEventTest.java

示例15: rowSetPopulated

import javax.sql.RowSetEvent; //导入依赖的package包/类
@Override
public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:StubWebRowSetImpl.java


注:本文中的javax.sql.RowSetEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。