Examples of moveToCurrentRow()


Examples of java.sql.ResultSet.moveToCurrentRow()

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

Examples of java.sql.ResultSet.moveToCurrentRow()

                                          "on insertRow before positioning");

        rs.next();
        rs.moveToInsertRow();
        checkDetectabilityCallsOutsideRow(rs, "on insertRow");
        rs.moveToCurrentRow(); // needed until to DERBY-1322 is fixed

        rs.beforeFirst();
        checkDetectabilityCallsOutsideRow(rs, "on beforeFirst row");

        rs.afterLast();
View Full Code Here

Examples of java.sql.ResultSet.moveToCurrentRow()

        } catch (SQLException se) {
            assertSQLState("XCL16", se);
        }
       
        try {
            rs.moveToCurrentRow();
            fail("FAIL - moveToCurrentRow can not be called on closed RS");
        } catch (SQLException se) {
            assertSQLState("XCL16", se);
        }
       
View Full Code Here

Examples of java.sql.ResultSet.moveToCurrentRow()

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

Examples of java.sql.ResultSet.moveToCurrentRow()

        c42 = rs.getInt(2);
        assertEquals("FAIL - wrong value for column c41", 5, c41);
        assertEquals("FAIL - wrong value for column c42", 5, c42);
       
        // Test moveToCurrentRow
        rs.moveToCurrentRow();
        assertEquals("FAIL - wrong value for column c41", c41old, rs.getInt(1));
        assertEquals("FAIL - wrong value for column c42", c42old, rs.getInt(2));
       
        // Test calling moveToCurrentRow from currentRow
        rs.moveToCurrentRow();
View Full Code Here

Examples of java.sql.ResultSet.moveToCurrentRow()

        rs.moveToCurrentRow();
        assertEquals("FAIL - wrong value for column c41", c41old, rs.getInt(1));
        assertEquals("FAIL - wrong value for column c42", c42old, rs.getInt(2));
       
        // Test calling moveToCurrentRow from currentRow
        rs.moveToCurrentRow();
        assertEquals("FAIL - wrong value for column c41", c41old, rs.getInt(1));
        assertEquals("FAIL - wrong value for column c42", c42old, rs.getInt(2));
       
        // Test getXXX from insertRow
        rs.moveToInsertRow();
View Full Code Here

Examples of java.sql.ResultSet.moveToCurrentRow()

        Statement stmt = createStatement(
                ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
        ResultSet rs = stmt.executeQuery("SELECT * FROM t4");
        assertTrue("FAIL - row not found", rs.next());
       
        rs.moveToCurrentRow();
        try {
            rs.insertRow();
            fail("FAIL - insert row not allowed from current row");
        } catch (SQLException se) {
            assertSQLState("XJ086", se);
View Full Code Here

Examples of java.sql.ResultSet.moveToCurrentRow()

            rs.moveToInsertRow();
            rs.updateInt(1, 17);
            rs.updateString(2, "XXXX");
            rs.updateString(3, "LINE 17");
            rs.insertRow();
            rs.moveToCurrentRow();
            rs.last();
//            assertTrue(rs.rowInserted()); // MS API cursors appear not to support this
            Statement stmt2 = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
            ResultSet rs2 = stmt2.executeQuery("SELECT * FROM jTDS_CachedCursorTest ORDER BY key1");
            rs.updateString(3, "NEW LINE 17");
View Full Code Here

Examples of java.sql.ResultSet.moveToCurrentRow()

  public void testZeroRowResult() throws SQLException {
    Statement st = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    ResultSet rs = st.executeQuery("select * from updateable WHERE 0 > 1");
    assertTrue(!rs.next());
    rs.moveToInsertRow();
    rs.moveToCurrentRow();
  }

  @Test
  @Ignore
  public void testUpdateable() throws SQLException {
View Full Code Here

Examples of java.sql.ResultSet.moveToCurrentRow()

    rs.insertRow();
    rs.updateInt("id", 5);
    rs.updateString("name", "dave5");
    rs.insertRow();

    rs.moveToCurrentRow();
    assertEquals(3, rs.getInt("id"));
    assertEquals("dave3", rs.getString("name"));

    assertTrue(rs.next());
    assertEquals(4, rs.getInt("id"));
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.