Package java.sql

Examples of java.sql.ResultSet.previous()


           
            assertEquals("m",rs.getString(1).trim());
            assertEquals(13, rs.getInt(2));
            assertEquals(12, rs.getRow());
           
            rs.previous();
            assertEquals("l",rs.getString(1).trim());
            assertEquals(12, rs.getInt(2));
            assertEquals(11, rs.getRow());
           
            rs.close();
View Full Code Here


            rs.last();
            assertEquals("m",rs.getString(1).trim());
            assertEquals(13, rs.getInt(2));
            assertEquals(3, rs.getRow());
           
            rs.previous();
            assertEquals("l",rs.getString(1).trim());
            assertEquals(12, rs.getInt(2));
            assertEquals(2, rs.getRow());
           
            rs.afterLast();
View Full Code Here

            assertEquals(2, rs.getRow());
           
            rs.afterLast();
            assertNoCurrentRow(rs);
           
            rs.previous();
            assertEquals("m",rs.getString(1).trim());
            assertEquals(13, rs.getInt(2));
            assertEquals(3, rs.getRow());
            rs.close();
            // start at after ;ast/
View Full Code Here

            // start at after ;ast/
            rs = ps_c1.executeQuery();
            rs.afterLast();
            assertNoCurrentRow(rs);
           
            rs.previous();
            assertEquals("m",rs.getString(1).trim());
            assertEquals(13, rs.getInt(2));
            assertEquals(3, rs.getRow());
            rs.close();
            ps_c1.close();
View Full Code Here

           rs.close();
           rs = ps_c1.executeQuery();
           rs.absolute(13);
           assertNoCurrentRow(rs);
          
           rs.previous();
           assertEquals(13, rs.getInt(1));
           assertEquals(12, rs.getRow());
           rs.close();
           rs = ps_c1.executeQuery();
           rs.absolute(-13);
View Full Code Here

            ResultSet rs = ps_c1.executeQuery();
            rs.first();
            assertEquals(1,rs.getInt(1));
            rs.next();
            assertEquals(2,rs.getInt(1));
            rs.previous();
            assertEquals(1,rs.getInt(1));
            rs.last();
            assertEquals(5,rs.getInt(1));
            rs.absolute(2);
            assertEquals(2, 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) + ")");
       
        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

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.