Package javax.sql.rowset

Examples of javax.sql.rowset.JdbcRowSet.rollback()


        assertTrue(jrs.getAutoCommit());
        assertTrue(jrs.absolute(3));
        jrs.updateString(2, "update3");
        jrs.updateRow();
        jrs.rollback();

        // after rollback, resultset is closed
        assertNull(jrs.getStatement());
        try {
            jrs.getString(2);
View Full Code Here


        assertFalse(jrs.getAutoCommit());
        assertTrue(jrs.absolute(3));
        jrs.updateString(2, "update3");
        jrs.updateRow();
        jrs.commit();
        jrs.rollback();

        /*
         * TODO why throw NullPointerException after call rollback()?
         */
        try {
View Full Code Here

        } catch (NullPointerException e) {
            // expected
        }

        try {
            jrs.rollback();
            fail("Should throw NullPointerException");
        } catch (NullPointerException e) {
            // expected
        }
View Full Code Here

        JdbcRowSet jrs = newJdbcRowSet();
        jrs.setUrl(DERBY_URL);
        jrs.setCommand("SELECT * FROM USER_INFO");

        try {
            jrs.rollback();
            fail("Shuld throw NullPointerException since jrs has not been executed.");
        } catch (NullPointerException e) {
            // Expected.
        }

View Full Code Here

        jrs.moveToCurrentRow();
        assertTrue(jrs.absolute(6));
        assertEquals(6, jrs.getInt(1));

        // Rollbacks
        jrs.rollback();
        try {
            jrs.first();
            fail("After rolling back, jrs can't do anything except close.");
        } catch (NullPointerException e) {
            // Expected.
View Full Code Here

        }

        try {
            assertTrue(jrs.getAutoCommit());
            jrs.setAutoCommit(true);
            jrs.rollback();
            // The behaviour of jrs should be same with the connection.

            if (hasRollbackException) {
                fail("Should throw SQLException");
            }
View Full Code Here

        JdbcRowSet jrs = newJdbcRowSet();
        jrs.setUrl(DERBY_URL);
        jrs.setCommand("SELECT * FROM USER_INFO");

        try {
            jrs.rollback(null);
            fail("Shuld throw NullPointerException since jrs has not been executed.");
        } catch (NullPointerException e) {
            // Expected.
        }
        Savepoint savepoint = new MockSavepoint(1, "mock savepoint 1");
View Full Code Here

        } catch (NullPointerException e) {
            // Expected.
        }
        Savepoint savepoint = new MockSavepoint(1, "mock savepoint 1");
        try {
            jrs.rollback(savepoint);
            fail("Shuld throw NullPointerException since jrs has not been executed.");
        } catch (NullPointerException e) {
            // Expected.
        }
View Full Code Here

        }

        jrs.execute();

        try {
            jrs.rollback(null);
            fail("Should throw SQLException since autoCommit is on");
        } catch (SQLException e) {
            // Expected
        }
        try {
View Full Code Here

            fail("Should throw SQLException since autoCommit is on");
        } catch (SQLException e) {
            // Expected
        }
        try {
            jrs.rollback(savepoint);
            fail("Should throw SQLException since autoCommit is on");
        } catch (SQLException e) {
            // Expected
        }
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.