Java 类javax.sql.RowSetEvent 实例源码

项目:In-the-Box-Fork    文件:RowSetEventTest.java   
/**
 * @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());
}
项目:cn1    文件:CachedRowSetImpl.java   
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();
        }
    }
}
项目:cn1    文件:CachedRowSetListenerTest.java   
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());
    }
}
项目:freeVM    文件:CachedRowSetImpl.java   
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();
        }
    }
}
项目:freeVM    文件:CachedRowSetListenerTest.java   
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());
    }
}
项目:power-matchmaker    文件:RowSetModel.java   
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) {
    }
}
项目:In-the-Box-Fork    文件:RowSetListenerTest.java   
/**
 * 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");
}
项目:In-the-Box-Fork    文件:RowSetListenerTest.java   
/**
 * 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");
}
项目:In-the-Box-Fork    文件:RowSetListenerTest.java   
/**
 * 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");
}
项目:cn1    文件:BaseRowSet.java   
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));
    }
}
项目:cn1    文件:BaseRowSet.java   
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));
    }
}
项目:cn1    文件:BaseRowSet.java   
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));
    }
}
项目:cn1    文件:RowSetEventTest.java   
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());
}
项目:cn1    文件:CachedRowSetListenerTest.java   
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());
}
项目:cn1    文件:CachedRowSetImplTest.java   
public void rowSetChanged(RowSetEvent theEvent) {
    if (isPrint) {
        System.out.println("rowSetChanged");
    }
    tag = CachedRowSetListenerTest.EVENT_ROWSET_CHANGED;
    eventSource = theEvent.getSource();
}
项目:freeVM    文件:BaseRowSet.java   
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));
    }
}
项目:freeVM    文件:BaseRowSet.java   
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));
    }
}
项目:freeVM    文件:BaseRowSet.java   
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));
    }
}
项目:freeVM    文件:RowSetEventTest.java   
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());
}
项目:freeVM    文件:BaseRowSet.java   
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));
    }
}
项目:freeVM    文件:BaseRowSet.java   
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));
    }
}
项目:freeVM    文件:BaseRowSet.java   
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));
    }
}
项目:freeVM    文件:RowSetEventTest.java   
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());
}
项目:freeVM    文件:CachedRowSetListenerTest.java   
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());
}
项目:freeVM    文件:CachedRowSetImplTest.java   
public void rowSetChanged(RowSetEvent theEvent) {
    if (isPrint) {
        System.out.println("rowSetChanged");
    }
    tag = CachedRowSetListenerTest.EVENT_ROWSET_CHANGED;
    eventSource = theEvent.getSource();
}
项目:jdk8u-jdk    文件:StubWebRowSetImpl.java   
@Override
public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:jdk8u-jdk    文件:TestRowSetListener.java   
@Override
public void rowSetChanged(RowSetEvent event) {
    flag |= ROWSET_CHANGED;
}
项目:jdk8u-jdk    文件:TestRowSetListener.java   
@Override
public void rowChanged(RowSetEvent event) {
    flag |= ROW_CHANGED;
}
项目:jdk8u-jdk    文件:TestRowSetListener.java   
@Override
public void cursorMoved(RowSetEvent event) {
    flag |= CURSOR_MOVED;
}
项目:jdk8u-jdk    文件:StubFilteredRowSetImpl.java   
@Override
public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:jdk8u-jdk    文件:StubCachedRowSetImpl.java   
@Override
public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:jdk8u-jdk    文件:StubJoinRowSetImpl.java   
@Override
public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:openjdk-jdk10    文件:StubWebRowSetImpl.java   
@Override
public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:openjdk-jdk10    文件:TestRowSetListener.java   
@Override
public void rowSetChanged(RowSetEvent event) {
    flag |= ROWSET_CHANGED;
}
项目:openjdk-jdk10    文件:TestRowSetListener.java   
@Override
public void rowChanged(RowSetEvent event) {
    flag |= ROW_CHANGED;
}
项目:openjdk-jdk10    文件:TestRowSetListener.java   
@Override
public void cursorMoved(RowSetEvent event) {
    flag |= CURSOR_MOVED;
}
项目:openjdk-jdk10    文件:StubFilteredRowSetImpl.java   
@Override
public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:openjdk-jdk10    文件:StubCachedRowSetImpl.java   
@Override
public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:openjdk-jdk10    文件:StubJoinRowSetImpl.java   
@Override
public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
项目:openjdk9    文件:StubWebRowSetImpl.java   
@Override
public void rowSetPopulated(RowSetEvent event, int numRows) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}