Package java.sql

Examples of java.sql.ResultSet.previous()


        assertTrue(rs.isAfterLast());

        assertFalse(rs.absolute(5));
        assertTrue(rs.isAfterLast());

        assertTrue(rs.previous());
        assertEquals(3, rs.getRow());

        assertTrue(rs.previous());
        assertEquals(2, rs.getRow());
View Full Code Here


        assertTrue(rs.isAfterLast());

        assertTrue(rs.previous());
        assertEquals(3, rs.getRow());

        assertTrue(rs.previous());
        assertEquals(2, rs.getRow());

        conn.close();
    }
View Full Code Here

                assertEquals("Should return false when going past the end: " + i, false, cs.next()); //$NON-NLS-1$
                assertEquals("Is after last should be true: " + i, true, cs.isAfterLast()); //$NON-NLS-1$
            }
           
            // Should still be just after last row
            cs.previous();
            assertEquals("Is last should be true", true, cs.isLast()); //$NON-NLS-1$
            assertEquals("Not on last row", lastRowValue, cs.getObject(1));              //$NON-NLS-1$
           
        } finally {
            cs.close();
View Full Code Here

                + "\" at position "
                + (res.getRow() - 1), res.getString(
                    "COLUMN_NAME"), columnNames[res.getRow() - 1]);
        }

        res.previous();
        assertEquals("not enough columns in table \"" + tableName + "\"",
                     columnNames.length, res.getRow());
    }

    /**
 
View Full Code Here

            println("T2: commit");
        } catch (SQLException e) {
            con2.rollback();
            throw e;
        }
        rs.previous(); // Go back to first tuple
        println("T1: Read previous Tuple:(" + rs.getInt(1) + "," +
                rs.getInt(2) + "," +
                rs.getInt(3) + ")");
       
        PreparedStatement ps = prepareStatement
View Full Code Here

        } catch (SQLException e) {
            con2.rollback();
            throw e;
        }
        println("T1: read previous tuple");
        rs.previous(); // Go back to first tuple
        println("T1: id=" + rs.getInt(1));
        rs.updateInt(2, 3);
        println("T1: updateInt(2, 3);");
        rs.updateRow();
        println("T1: updated column 2, to value=3");
View Full Code Here

            println("T4: commit");
        } catch (SQLException e) {
            con2.rollback();
            throw e;
        }
        rs.previous(); // Go back to first tuple
        println("T1: Read previous Tuple:(" + rs.getInt(1) + "," +
                rs.getInt(2) + "," +
                rs.getInt(3) + ")");
       
        println("T1: id=" + rs.getInt(1));
View Full Code Here

            println("T2: commit");
        } catch (SQLException e) {
            con2.rollback();
            throw e;
        }
        rs.previous(); // Go back to first tuple
        println("T1: Read previous Tuple:(" + rs.getInt(1) + "," +
                rs.getInt(2) + "," +
                rs.getInt(3) + ")");
        rs.updateInt(2, 3);
        rs.updateRow();
View Full Code Here

            println("T2: commit");
        } catch (SQLException e) {
            con2.rollback();
            throw e;
        }
        rs.previous(); // Go back to first tuple
        println("T1: Read previous Tuple:(" + rs.getInt(1) + "," +
                rs.getInt(2) + "," +
                rs.getInt(3) + ")");
        rs.updateInt(3, 9999);
        rs.updateRow();
View Full Code Here

      passed = false;
    }
    // Iterate backwards thru RS, expect only 4 more (5 total) rows.
    for (int index = 1; index < 5; index++)
    {
      if (! rs.previous())
      {
        System.out.println("rs.previous() failed, index = " + index);
        passed = false;
        break;
      }
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.