Package java.sql

Examples of java.sql.ResultSet.updateLong()


                        + entity.getName());
            }

            long nextId = rs.getLong(1);

            rs.updateLong(1, nextId + pkCacheSize);
            rs.updateRow();

            if (rs.next()) {
                throw new CayenneException("More than one PK record for table: "
                        + entity.getName());
View Full Code Here


                ResultSet.CONCUR_UPDATABLE);
        ResultSet rs = s.executeQuery(SELECT_STMT);
        rs.next();

        for (int i = 1; i <= COLUMNS; i++) {
            rs.updateLong(i, 2L);
            assertEquals("Expected rs.getLong(" + i +
                         ") to match updated value", 2L, rs.getLong(i));
        }
        rs.updateRow();
        rs.close();
View Full Code Here

                        rs.updateInt(ColumnNames[sqlType-1],
                                rs1.getInt(updateXXXName));
                } else if (updateXXXName ==  3) {
                    //update column with updateLong methods
                    if (indexOrName == 1) //test by passing column position
                        rs.updateLong(sqlType, rs1.getLong(updateXXXName));
                    else //test by passing column name
                        rs.updateLong(ColumnNames[sqlType-1],
                                rs1.getLong(updateXXXName));
                } else if (updateXXXName == 4) {
                    if (!JDBC.vmSupportsJSR169())
View Full Code Here

                } else if (updateXXXName ==  3) {
                    //update column with updateLong methods
                    if (indexOrName == 1) //test by passing column position
                        rs.updateLong(sqlType, rs1.getLong(updateXXXName));
                    else //test by passing column name
                        rs.updateLong(ColumnNames[sqlType-1],
                                rs1.getLong(updateXXXName));
                } else if (updateXXXName == 4) {
                    if (!JDBC.vmSupportsJSR169())
                    {
                        //update column with updateBigDecimal methods
View Full Code Here

        assertTrue("FAIL - row not found", rs.next());
        assertEquals("FAIL - wrong value for column c1", 2, rs.getInt(1));
        // this update row will fire the update trigger which will update all
        // the rows in the table to have c1=1 and hence no more rows will
        // qualify for the resultset
        rs.updateLong(2,2);
        rs.updateRow();
        try {
            assertFalse("FAIL - row not found", rs.next());
            rs.updateRow();
            fail("FAIL - there should have be no more rows in the resultset " +
View Full Code Here

       
        rs = stmt.executeQuery("SELECT * FROM table0WithTriggers");
        assertTrue("FAIL - row not found", rs.next());
        assertEquals("FAIL - wrong value for column 1", 1, rs.getInt(1));
        println("now try to update row and make sure that trigger got fired");
        rs.updateLong(1,123);
        rs.updateRow();
        rs.close();
       
        // Verify that update trigger got fired by verifying the row count to be
        // 1 in updateTriggerInsertIntoThisTable
View Full Code Here

        assertTrue("FAIL - statement should return a row", rs.next());
        assertEquals("FAIL - wrong value for column 1", 1, rs.getInt(1));
        // now try to delete row when primary key is not selected for that row
        rs.deleteRow();
        assertTrue("FAIL - statement should return a row", rs.next());
        rs.updateLong(1,123);
        rs.updateRow();
        rs.close();
       
        // verify that the table was correctly update
        String[][] expected = {{"2", "123"}, {"3", "3"}, {"4", "4"}};
View Full Code Here

                ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
        ResultSet rs = stmt.executeQuery("SELECT * FROM t1 FOR UPDATE of c1");
        assertTrue("FAIL - statement should return a row", rs.next());
        assertFalse("FAIL - rs.rowUpdated() should always return false for " +
                "this type of result set", rs.rowUpdated());
        rs.updateLong(1,123);
        rs.updateRow();
        rs.close();
        stmt.close();
    }
   
View Full Code Here

        assertEquals("FAIL - wrong value for column c21", 1, rs.getInt(2));
        rs.close();
       
        rs = stmt.executeQuery("select c31 from session.t3");
        assertTrue("FAIL - row not found", rs.next());
        rs.updateLong(1,123);
        rs.updateRow();
        assertTrue("FAIL - row not found", rs.next());
        rs.updateLong(1,123);
        rs.updateRow();
        rs.close();
View Full Code Here

        rs = stmt.executeQuery("select c31 from session.t3");
        assertTrue("FAIL - row not found", rs.next());
        rs.updateLong(1,123);
        rs.updateRow();
        assertTrue("FAIL - row not found", rs.next());
        rs.updateLong(1,123);
        rs.updateRow();
        rs.close();
       
        int countRows = 0;
        rs = stmt.executeQuery("select * from SESSION.t3");
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.