Package javax.sql.rowset

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


            connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
         ResultSet resultSet = statement.executeQuery(query);

         CachedRowSet crs = new CachedRowSetImpl();
         crs.setPageSize(pageList.getPageSize());
         crs.populate(resultSet, (pageList.getCurrentPage() - 1) * pageList.getPageSize() + 1);

         while (crs.next())
         {
            T bean = dao_.createInstance();
            dao_.getDBObjectMapper().mapResultSet(crs, bean);
View Full Code Here


    public void testDeleteRow_MultipleRowSets() throws Exception {
        // Creates a new CachedRowSet from BOOKs
        CachedRowSet crset2 = newNoInitialInstance();
        rs = st.executeQuery("select * from BOOKS");
        crset2.populate(rs);

        jrs.addRowSet(crset, 1);
        jrs.addRowSet(crset2, 1);

        int rowNum = 0;
View Full Code Here

    public void testInsertRow_MultipleRowSets() throws Exception {
        // Creates a new CachedRowSet from BOOKs
        CachedRowSet crset2 = newNoInitialInstance();
        rs = st.executeQuery("select * from BOOKS");
        crset2.populate(rs);

        jrs.addRowSet(crset2, 1);

        int rowNum = 0;
        jrs.beforeFirst();
View Full Code Here

        // fill the duplicate CachedRowSet with data, check the listener
        Listener listener = new Listener();
        crsetCopySchema.addRowSetListener(listener);
        assertNull(listener.getTag());
        rs = st.executeQuery("select * from USER_INFO");
        crsetCopySchema.populate(rs);
        assertEquals("rowSetChanged", listener.getTag());
        listener.clear();
        // the move of the original's cursor shouldn't affect the duplicate
        crset.next();
        assertNull(listener.getTag());
View Full Code Here

        /*
         * Add another RowSet
         */
        insertDataToCustomerTable();
        CachedRowSet thirdRs = newNoInitialInstance();
        thirdRs.populate(st.executeQuery("SELECT * FROM CUSTOMER_INFO"));
        jrs.addRowSet(thirdRs, "ID");

        // check metadata
        assertEquals(15, jrs.getMetaData().getColumnCount());
        isMetaDataEqualsInColCount(crset.getMetaData(), 2, crset.getMetaData()
View Full Code Here

        /*
         * Add the second CachedRowSet, populate with table CUSTOMER_INFO
         */
        insertDataToCustomerTable();
        CachedRowSet newCrset = newNoInitialInstance();
        newCrset.populate(st.executeQuery("SELECT * FROM CUSTOMER_INFO"));
        jrs.addRowSet(newCrset, "NAME");

        /*
         * TODO NOTICE The difference between RI and Harmony
         */
 
View Full Code Here

        CachedRowSet base = newNoInitialInstance();
        rs = st.executeQuery("select * from USER_INFO");
        rs.next();
        rs.next();
        rs.next();
        base.populate(rs);

        CachedRowSet join = newNoInitialInstance();
        rs = st.executeQuery("select * from USER_INFO");
        rs.next();
        rs.next();
View Full Code Here

        CachedRowSet join = newNoInitialInstance();
        rs = st.executeQuery("select * from USER_INFO");
        rs.next();
        rs.next();
        rs.next();
        join.populate(rs);

        base.setMatchColumn(first);

        join.setMatchColumn(second);

View Full Code Here

        assertEquals(2, jrs.getRowSetNames().length);
        assertEquals("USER_INFO", jrs.getRowSetNames()[0]);
        assertEquals("BOOKS", jrs.getRowSetNames()[1]);
        // add the third CachedRowSet which doesn't set a table name
        CachedRowSet thirdCrset = newNoInitialInstance();
        thirdCrset.populate(st.executeQuery("SELECT * FROM CUSTOMER_INFO"));
        thirdCrset.setMatchColumn(1);
        if ("true".equals(System.getProperty("Testing Harmony"))) {
            jrs.addRowSet(thirdCrset);
            assertEquals(3, jrs.getRowSetNames().length);
            assertEquals("CUSTOMER_INFO", jrs.getRowSetNames()[2]);
View Full Code Here

        /*
         * The third CachedRowSet
         */
        insertDataToCustomerTable();
        CachedRowSet thirdCrset = newNoInitialInstance();
        thirdCrset.populate(st.executeQuery("SELECT * FROM CUSTOMER_INFO"));
        jrs.addRowSet(thirdCrset, 1);
        toCrset = jrs.toCachedRowSet();
        // check metadata
        assertSame(jrs.getMetaData(), toCrset.getMetaData());
        // check data
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.