Package javax.sql.rowset

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


    public void testAutoCommit_False() throws Exception {
        JdbcRowSet jrs = newJdbcRowSet();
        jrs.setCommand("SELECT * FROM USER_INFO");
        jrs.setUrl(DERBY_URL);
        jrs.execute();

        jrs.setAutoCommit(false);
        assertFalse(jrs.getAutoCommit());
        assertTrue(jrs.absolute(3));
        jrs.updateString(2, "update3");
View Full Code Here


        assertEquals(DERBY_URL, jrs.getUrl());
        assertNull(jrs.getUsername());
        assertNull(jrs.getPassword());

        jrs.execute();

        // after execute
        assertEquals(ResultSet.TYPE_SCROLL_INSENSITIVE, jrs.getType());
        assertTrue(jrs.getEscapeProcessing());
View Full Code Here

    public void testCursorMove() throws Exception {
        insertMoreData(6);
        JdbcRowSet jrs = newJdbcRowSet();
        jrs.setUrl(DERBY_URL);
        jrs.setCommand("SELECT * FROM USER_INFO");
        jrs.execute();

        jrs.beforeFirst();
        assertTrue(jrs.isBeforeFirst());
        assertTrue(jrs.next());
        assertTrue(jrs.first());
View Full Code Here

    public void testExecute() throws Exception {
        JdbcRowSet jrs = newJdbcRowSet();
        jrs.setUrl("bad url");

        try {
            jrs.execute();
            fail("Should SQLException");
        } catch (SQLException e) {
            // expected, No suitable driver
        }
View Full Code Here

            // expected, No suitable driver
        }

        jrs = newJdbcRowSet();
        try {
            jrs.execute();
            fail("should throw NullPointerException");
        } catch (NullPointerException e) {
            // expected
        }
        jrs.setUrl(DERBY_URL);
View Full Code Here

    public void testAfterClose() throws Exception {
        JdbcRowSet jrs = newJdbcRowSet();
        jrs.setCommand("SELECT * FROM USER_INFO");
        jrs.setUrl(DERBY_URL);
        jrs.execute();
        jrs.close();

        try {
            jrs.absolute(1);
            fail("Should throw NullPointerException");
View Full Code Here

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

        jrs.execute();
        assertTrue(jrs.absolute(4));
        assertEquals(4, jrs.getInt(1));

        // Inserts a new row.
        jrs.moveToInsertRow();
View Full Code Here

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

        jrs.execute();
        assertTrue(jrs.absolute(4));
        assertEquals(4, jrs.getInt(1));

        // Inserts a new row.
        jrs.moveToInsertRow();
View Full Code Here

        // Reconnect
        jrs = newJdbcRowSet();
        jrs.setUrl(DERBY_URL);
        jrs.setCommand("SELECT * FROM USER_INFO");
        jrs.execute();
        assertTrue(jrs.last());
        assertEquals(
                "Since the insert action was roll back, so the last row is 5, not 6.",
                5, jrs.getInt(1));

View Full Code Here

     */
    public void testRollbackException() throws Exception {
        JdbcRowSet jrs = newJdbcRowSet();
        jrs.setUrl(DERBY_URL);
        jrs.setCommand("SELECT * FROM USER_INFO");
        jrs.execute();

        // Tests if jrs has the same behaviour with connection when commit in
        // auto-commit mode.
        boolean hasRollbackException = 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.