Package java.sql

Examples of java.sql.ResultSet.absolute()


                }
                if (!rs.isBeforeFirst()) {
                    System.out.println("isBeforeFirst should be true");
                }

                rs.absolute(rows/2);
                if (rs.relative(rows)) {
                    System.out.println("relative(" + (rows) + ") should return false, position outside of the resultSet");
                }
                if (!rs.isAfterLast()) {
                    System.out.println("isAfterLast should be true");
View Full Code Here


                    System.out.println("relative(" + (rows) + ") should return false, position outside of the resultSet");
                }
                if (!rs.isAfterLast()) {
                    System.out.println("isAfterLast should be true");
                }
                rs.absolute(rows/2);
                if (rs.absolute(rows + 1)) {
                    System.out.println("absolute(" + (rows + 1) + ") should return false, position outside of the resultSet");
                    System.out.println("Current row: " + rs.getInt(1));
                }
                if (!rs.isAfterLast()) {
View Full Code Here

                }
                if (!rs.isAfterLast()) {
                    System.out.println("isAfterLast should be true");
                }
                rs.absolute(rows/2);
                if (rs.absolute(rows + 1)) {
                    System.out.println("absolute(" + (rows + 1) + ") should return false, position outside of the resultSet");
                    System.out.println("Current row: " + rs.getInt(1));
                }
                if (!rs.isAfterLast()) {
                    System.out.println("isAfterLast should be true");
View Full Code Here

                    System.out.println("Current row: " + rs.getInt(1));
                }
                if (!rs.isAfterLast()) {
                    System.out.println("isAfterLast should be true");
                }
                rs.absolute(rows/2);
                if (rs.absolute((-1) * (rows + 1))) {
                    System.out.println("absolute(" + (((-1) * (rows + 1))) + ") should return false, position outside of the resultSet");
                    System.out.println("Current row: " + rs.getInt(1));
                }
                if (!rs.isBeforeFirst()) {
View Full Code Here

                }
                if (!rs.isAfterLast()) {
                    System.out.println("isAfterLast should be true");
                }
                rs.absolute(rows/2);
                if (rs.absolute((-1) * (rows + 1))) {
                    System.out.println("absolute(" + (((-1) * (rows + 1))) + ") should return false, position outside of the resultSet");
                    System.out.println("Current row: " + rs.getInt(1));
                }
                if (!rs.isBeforeFirst()) {
                    System.out.println("isBeforeFirst should be true");
View Full Code Here

                            System.out.println(sqle.getMessage());
                        }
    }
    try
    {
      rs.absolute(1);
      // Should never get here
      System.out.println("absolute() expected to fail");
      passed = false;
    }
    catch (SQLException sqle)
View Full Code Here

        // Test that it is possible to move using absolute from insertRow
        currentPosition = rs.getRow();
        rs.moveToInsertRow();
        rs.updateInt(1, currentPosition + 1000);
        rs.absolute(6);
        assertEquals("CurrentPosition should be 6", rs.getRow(), 6);
        // should be able to delete the row
        rs.deleteRow();

        // Test that it is possible to move to previous row from insertRow
View Full Code Here

        if (resultSetType==ResultSet.TYPE_FORWARD_ONLY) {
            for (int i = 0; i < recordToUpdate; i++) {
                rs.next();
            }
        } else {
            rs.absolute(recordToUpdate);
        }
       
        commit();
       
        PreparedStatement ps =
View Full Code Here

    {
        Statement s = createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
                                          ResultSet.CONCUR_UPDATABLE);
        s.setCursorName(getNextCursorName());
        ResultSet rs = s.executeQuery("select * from t1");
        rs.absolute(5);
        final int oldCol2 = rs.getInt(2);
        final int newCol2 = -2222;
        final int oldCol3 = rs.getInt(3);
        final int newCol3 = -3333;
               
View Full Code Here

    {
        Statement s = createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
                                          ResultSet.CONCUR_UPDATABLE);
        s.setCursorName(getNextCursorName());
        ResultSet rs = s.executeQuery("select * from t1");
        rs.absolute(5);
        final int oldCol2 = rs.getInt(2);
        final int oldCol3 = rs.getInt(3);
       
        rs.updateNull(2);
        assertEquals("Expected the resultset to be updated after updateNull",
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.