Package javax.sql.rowset

Examples of javax.sql.rowset.CachedRowSet.populate()


        }

        // Creates a new CachedRowSet from BOOKs
        CachedRowSet crset2 = newNoInitialInstance();
        rs = st.executeQuery("select * from BOOKS");
        crset2.populate(rs);

        jrs.addRowSet(crset2, 3);

        CachedRowSet dbJoinCrset = newNoInitialInstance();
        rs = st
View Full Code Here


                .executeQuery("select USER_INFO.ID, USER_INFO.NAME, USER_INFO.BIGINT_T, USER_INFO.NUMERIC_T, USER_INFO.DECIMAL_T, "
                        + "USER_INFO.SMALLINT_T, USER_INFO.FLOAT_T, USER_INFO.REAL_T, USER_INFO.DOUBLE_T, USER_INFO.DATE_T, USER_INFO.TIME_T, USER_INFO.TIMESTAMP_T, "
                        + "BOOKS.AUTHORID, BOOKS.SN"
                        + " from USER_INFO, BOOKS "
                        + "where USER_INFO.NAME = BOOKS.NAME");
        dbJoinCrset.populate(rs);

        dataEquals = dataEqualsIgnoreOrderAndNullInR2(jrs, dbJoinCrset, 2);
        if (!dataEquals) {
            fail("The data is jrs and dbJoinCrset should be equal.");
        }
View Full Code Here

                .executeQuery("select BOOKS.AUTHORID, BOOKS.SN, BOOKS.NAME, USER_INFO.ID, USER_INFO.BIGINT_T, USER_INFO.NUMERIC_T, USER_INFO.DECIMAL_T, "
                        + "USER_INFO.SMALLINT_T, USER_INFO.FLOAT_T, USER_INFO.REAL_T, USER_INFO.DOUBLE_T, USER_INFO.DATE_T, USER_INFO.TIME_T, USER_INFO.TIMESTAMP_T "
                        + " from USER_INFO, BOOKS "
                        + "where USER_INFO.NAME = BOOKS.NAME");
        dbJoinCrset = newNoInitialInstance();
        dbJoinCrset.populate(rs);

        jrs.addRowSet(crset, 2);
        dataEquals = dataEqualsIgnoreOrderAndNullInR2(jrs, dbJoinCrset, 3);
        if (!dataEquals) {
            fail("The data is jrs and dbJoinCrset should be equal.");
View Full Code Here

    }

    public void testJoin_SameTable() throws Exception {
        CachedRowSet crset2 = newNoInitialInstance();
        rs = st.executeQuery("select * from BOOKS");
        crset2.populate(rs);

        CachedRowSet dbJoinCrset = newNoInitialInstance();
        rs = st.executeQuery("select BOOKS1.AUTHORID, BOOKS1.SN, BOOKS1.NAME, "
                + "BOOKS.AUTHORID, BOOKS.NAME"
                + " from BOOKS as BOOKS1, BOOKS "
View Full Code Here

        CachedRowSet dbJoinCrset = newNoInitialInstance();
        rs = st.executeQuery("select BOOKS1.AUTHORID, BOOKS1.SN, BOOKS1.NAME, "
                + "BOOKS.AUTHORID, BOOKS.NAME"
                + " from BOOKS as BOOKS1, BOOKS "
                + "where BOOKS1.SN = BOOKS.SN");
        dbJoinCrset.populate(rs);

        jrs.addRowSet(crset2, "SN");
        jrs.addRowSet(crset2, "SN");

        boolean dataEquals = dataEqualsIgnoreOrder(jrs, dbJoinCrset);
View Full Code Here

    public void testJoin_Unsortable() throws Exception {
        addUnsortableToBooksTable();

        CachedRowSet crset2 = newNoInitialInstance();
        rs = st.executeQuery("select * from BOOKS");
        crset2.populate(rs);

        boolean dataEquals;
        try {
            jrs.addRowSet(crset2, 4);
            if ("true".equals(System.getProperty("Testing Harmony"))) {
View Full Code Here

    // Else, the cursor moves to the last one (not afterLast).
    public void testJoin_OriginalCursorPosition() throws Exception {
        // Create crset2.
        rs = st.executeQuery("select * from BOOKS");
        CachedRowSet crset2 = newNoInitialInstance();
        crset2.populate(rs);

        assertTrue(crset.isBeforeFirst());
        jrs.addRowSet(crset, 1);
        assertTrue(crset.isBeforeFirst());

View Full Code Here

    }

    public void testJoin_CursorPosition() throws Exception {
        rs = st.executeQuery("select * from BOOKS");
        CachedRowSet crset2 = newNoInitialInstance();
        crset2.populate(rs);

        // TODO
        // Tests when there is no rowSet.
        // Not determined in harmony.
        // assertTrue(jrs.isLast());
View Full Code Here

    }

    public void testJoin_Delete() throws Exception {
        rs = st.executeQuery("select * from BOOKS");
        CachedRowSet crset2 = newNoInitialInstance();
        crset2.populate(rs);

        jrs.addRowSet(crset, 1);
        jrs.first();
        jrs.deleteRow();

View Full Code Here

    }

    public void testJoin_Delete2() throws Exception {
        rs = st.executeQuery("select * from BOOKS");
        CachedRowSet crset2 = newNoInitialInstance();
        crset2.populate(rs);

       crset.absolute(3);
        crset.deleteRow();
        crset.setShowDeleted(true);

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.