Package java.sql

Examples of java.sql.ResultSet.updateNull()


                     0, rs.getInt(2));
        assertTrue("Expected wasNull to be true after updateNull", rs.wasNull());
        rs.cancelRowUpdates();
        assertEquals("Expected updateXXX to have no effect after cancelRowUpdated",
                     oldCol2, rs.getInt(2));
        rs.updateNull(2);
        assertEquals("Expected the resultset to be updated after updateNull",
                     0, rs.getInt(2));
        assertTrue("Expected wasNull to be true after updateNull", rs.wasNull());
        assertTrue("Expected rs.rowUpdated() to be false before updateRow",
                   !rs.rowUpdated());
View Full Code Here


        assertTrue("Expected rs.rowUpdated() to be true after updateRow",
                   rs.rowUpdated());
        assertEquals("Expected the resultset detect the updates of previous " +
                     "updateRow", 0, rs.getInt(2));
       
        rs.updateNull(3);
       
        assertEquals("Expected the resultset to be updated after updateNull",
                     0, rs.getInt(3));
        assertTrue("Expected wasNull to be true after updateNull", rs.wasNull());
        assertEquals("Expected the resultset detect the updates of previous " +
View Full Code Here

       
        assertEquals("Expected updateXXX to have no effect after " +
                     "cancelRowUpdated", oldCol3, rs.getInt(3));
        assertEquals("Expected the resultset detect the updates of previous " +
                     "updateRow after cancelRowUpdated", 0, rs.getInt(2));
        rs.updateNull(3);
        rs.updateRow();
        assertEquals("Expected the resultset to be updated after updateNull",
                     0, rs.getInt(3));
        rs.cancelRowUpdates();
       
View Full Code Here

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

        for (int i = 1; i <= COLUMNS; i++) {
            rs.updateNull(i);
            assertNull("Expected rs.getObject(" + i + ") to be null",
                       rs.getObject(i));
            assertTrue("Expected rs.wasNull() to return true",
                       rs.wasNull());
        }
View Full Code Here

                     0, rs.getInt(2));
        assertTrue("Expected wasNull to be true after updateNull", rs.wasNull());
        rs.cancelRowUpdates();
        assertEquals("Expected updateXXX to have no effect after cancelRowUpdated",
                     oldCol2, rs.getInt(2));
        rs.updateNull(2);
        assertEquals("Expected the resultset to be updated after updateNull",
                     0, rs.getInt(2));
        assertTrue("Expected wasNull to be true after updateNull", rs.wasNull());
        assertTrue("Expected rs.rowUpdated() to be false before updateRow",
                   !rs.rowUpdated());
View Full Code Here

        assertTrue("Expected rs.rowUpdated() to be true after updateRow",
                   rs.rowUpdated());
        assertEquals("Expected the resultset detect the updates of previous " +
                     "updateRow", 0, rs.getInt(2));
       
        rs.updateNull(3);
       
        assertEquals("Expected the resultset to be updated after updateNull",
                     0, rs.getInt(3));
        assertTrue("Expected wasNull to be true after updateNull", rs.wasNull());
        assertEquals("Expected the resultset detect the updates of previous " +
View Full Code Here

       
        assertEquals("Expected updateXXX to have no effect after " +
                     "cancelRowUpdated", oldCol3, rs.getInt(3));
        assertEquals("Expected the resultset detect the updates of previous " +
                     "updateRow after cancelRowUpdated", 0, rs.getInt(2));
        rs.updateNull(3);
        rs.updateRow();
        assertEquals("Expected the resultset to be updated after updateNull",
                     0, rs.getInt(3));
        rs.cancelRowUpdates();
       
View Full Code Here

        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",
                     0, rs.getInt(2));
        assertTrue("Expected wasNull to be true after updateNull", rs.wasNull());
        rs.cancelRowUpdates();
        assertEquals("Expected updateXXX to have no effect after cancelRowUpdated",
View Full Code Here

        try {
          ResultSet rs = stmt.executeQuery(query);
          if (rs.next()) {
            // This connector property exists, update the property value.
            if (fieldValue == null) {
              rs.updateNull(propertyValueColumn);
            } else {
              rs.updateString(propertyValueColumn, fieldValue);
            }
            // Bump the ModifyStamp, so others may know the value has changed.
            rs.updateInt(modifyStampColumn, rs.getInt(modifyStampColumn) + 1);
View Full Code Here

            rs.moveToInsertRow();
            rs.updateInt(modifyStampColumn, 1); // Bootstrap the ModifyStamp
            rs.updateString(connectorNameColumn, context.getConnectorName());
            rs.updateString(propertyNameColumn, fieldName);
            if (fieldValue == null) {
              rs.updateNull(propertyValueColumn);
            } else {
              rs.updateString(propertyValueColumn, fieldValue);
            }
            rs.insertRow();
          }
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.