Package java.sql

Examples of java.sql.ResultSet.insertRow()


        }
       
        try {
            rs.moveToCurrentRow();
            rs.updateInt(1, currentPosition + 2000);
            rs.insertRow();
        } catch (SQLException se) {
            assertEquals("Expected exception",
                    se.getSQLState().substring(0, 5),
                    CURSOR_NOT_POSITIONED_ON_INSERT_ROW);
        }
View Full Code Here


                ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
        ResultSet rs = stmt.executeQuery("SELECT * FROM t4");
        assertTrue("FAIL - row not found", rs.next());
        rs.moveToInsertRow();
        rs.updateInt(1, 7);
        rs.insertRow();
        rs.close();
       
        String[][] expected =
        {{"1", "1"}, {"2", "2"}, {"3", "3"}, {"4", "4"}, {"7", null}};
        rs = stmt.executeQuery("SELECT * FROM t4");
View Full Code Here

        assertTrue("FAIL - row not found", rs.next());
        rs.moveToInsertRow();
        rs.updateInt(1, 8);
        rs.updateInt(2, 8);
        commit();
        rs.insertRow();
        rs.close();
        stmt.close();
       
        getConnection().setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT);
        stmt = createStatement(
View Full Code Here

        rs.moveToInsertRow();
        rs.updateInt(1, 82);
        rs.updateInt(2, 82);
        commit();
        try {
            rs.insertRow();
            fail("FAIL - result set is not holdable and should be closed " +
                    "after commit");
        } catch (SQLException se) {
            assertSQLState("XCL16", se);
            // DERBY-4767, sample verification test for operation in XCL16 message.
View Full Code Here

        rs.moveToInsertRow();
        rs.updateInt(1, 9);
        rs.updateInt(2, 9);
        rs.close();
        try {
            rs.insertRow();
            fail("FAIL - insertRow can not be called on closed RS");
        } catch (SQLException se) {
            assertSQLState("XCL16", se);
        }
       
View Full Code Here

                ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
        ResultSet rs = stmt.executeQuery("SELECT * FROM t5");
        assertTrue("FAIL - row not found", rs.next());
        rs.moveToInsertRow();
        // Should insert a row with NULLS and DEFAULT VALUES
        rs.insertRow();
        rs.close();
       
        String[][] expected =
        {{"1", "1"}, {"2", "2"}, {"3", "3"}, {"4", "4"}, {"0", null}};
        rs = stmt.executeQuery("SELECT * FROM t5");
View Full Code Here

        ResultSet rs = stmt.executeQuery("SELECT * FROM t4");
        assertTrue("FAIL - row not found", rs.next());
        rs.moveToInsertRow();
        rs.updateInt(1, 4000);
        rs.updateInt(2, 4000);
        rs.insertRow();
        rollback();
        rs.close();
       
        String[][] expected = {{"1", "1"}, {"2", "2"}, {"3", "3"}, {"4", "4"}};
        rs = stmt.executeQuery("SELECT * FROM t4");
View Full Code Here

            assertSQLState("XJ083", se);
        }
       
        // test insertRow on read-only result set
        try {
            rs.insertRow();
            fail("FAIL - insertRow not allowed on read-only RS");
        } catch (SQLException se) {
            assertSQLState("XJ083", se);
        }
       
View Full Code Here

            // Insert a row
            rs.moveToInsertRow();
            rs.updateInt(1,42);
            rs.updateInt(2,42);
            rs.insertRow();

            // Delete a row
            rs.previous();
            rs.deleteRow();
View Full Code Here

        //
        rs = executeQuery( stmt, "select * from t_urs_1 for update" );
        rs.next();
        rs.moveToInsertRow();
        rs.updateInt( 1, 10 );
        rs.insertRow();
        rs.close();
        conn.commit();
        assertResults
            (
             conn,
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.