Package javax.sql

Examples of javax.sql.RowSetEvent


        }
        if (listeners.isEmpty()) {
            return;
        }
        for (RowSetListener listener : listeners) {
            listener.rowChanged(new RowSetEvent((RowSet) this));
        }
    }
View Full Code Here


        }
        if (listeners.isEmpty()) {
            return;
        }
        for (RowSetListener listener : listeners) {
            listener.rowSetChanged(new RowSetEvent((RowSet) this));
        }
    }
View Full Code Here

        }
        if (listeners.isEmpty()) {
            return;
        }
        for (RowSetListener listener : listeners) {
            listener.cursorMoved(new RowSetEvent((RowSet) this));
        }
    }
View Full Code Here

        }
        if (listeners.isEmpty()) {
            return;
        }
        for (RowSetListener listener : listeners) {
            listener.rowChanged(new RowSetEvent((RowSet) this));
        }
    }
View Full Code Here

        }
        if (listeners.isEmpty()) {
            return;
        }
        for (RowSetListener listener : listeners) {
            listener.rowSetChanged(new RowSetEvent((RowSet) this));
        }
    }
View Full Code Here

public class RowSetEventTest extends TestCase {

    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());
    }
View Full Code Here

        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());
    }
View Full Code Here

        noInitialCrset = newNoInitialInstance();
        Listener listener = new Listener();
        noInitialCrset.addRowSetListener(listener);

        listener.clear();
        noInitialCrset.rowSetPopulated(new RowSetEvent(crset), 20);
        assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
        assertEquals(noInitialCrset, listener.getEventSource());

        for (int i = 1; i <= 10; i++) {
            listener.clear();
            noInitialCrset.rowSetPopulated(new RowSetEvent(noInitialCrset), i);
            assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
        }

        rs = st.executeQuery("SELECT * FROM USER_INFO");
        noInitialCrset.populate(rs);
        noInitialCrset.setMaxRows(10);
        noInitialCrset.setFetchSize(2);

        listener.clear();
        noInitialCrset.rowSetPopulated(new RowSetEvent(noInitialCrset), 2);
        assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());

        listener.clear();
        noInitialCrset.rowSetPopulated(new RowSetEvent(noInitialCrset), 3);
        assertNull(listener.getTag());

        listener.clear();
        noInitialCrset.rowSetPopulated(new RowSetEvent(noInitialCrset), 4);
        assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());

        listener.clear();
        noInitialCrset.rowSetPopulated(new RowSetEvent(crset), 4);
        assertEquals(EVENT_ROWSET_CHANGED, listener.getTag());
        assertEquals(noInitialCrset, listener.getEventSource());
    }
View Full Code Here

        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());
        }
    }
View Full Code Here

        }
        if (listeners.isEmpty()) {
            return;
        }
        for (RowSetListener listener : listeners) {
            listener.cursorMoved(new RowSetEvent((RowSet) this));
        }
    }
View Full Code Here

TOP

Related Classes of javax.sql.RowSetEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.