Package java.sql

Examples of java.sql.ResultSet.updateRow()


            ResultSet rs = st.executeQuery(s);

            rs.absolute(10);
            rs.updateString(2, "UPDATE10");
            rs.updateRow();
            rs.absolute(11);
            rs.deleteRow();
            rs.moveToInsertRow();
            rs.updateInt(1, 1011);
            rs.updateString(2, "INSERT1011");
View Full Code Here


            // Update the blob
            Blob blob = rs.getBlob(1);
            blob.truncate(0);
            blob.setBytes(1, data);
            rs.updateBlob(1, blob);
            rs.updateRow();             // Update the row with the updated blob

        } finally {
            cleanupExclusiveLock.readLock().unlock();
            close(rs);
            close(s);
View Full Code Here

            while (rs.next()) {
                // note, this is guaranteed to be non-null and valid
                String path = rs.getString(2);
                String dir = getDir(path);
                rs.updateString(3, dir);
                rs.updateRow();
            }
        } finally {
            databaseType.closeStatement(s);
        }
    }
View Full Code Here

            ResultSet.TYPE_FORWARD_ONLY,
            ResultSet.CONCUR_UPDATABLE);
        rs = uSelect.executeQuery();
        rs.next();
        rs.updateDouble("F06", Float.MAX_VALUE * 10.0);
        rs.updateRow();

        rs = plainSelect.executeQuery();
        rs.next();

        assertGetState(rs, "F06", XXX_FLOAT, "22003");
View Full Code Here

        rs.close();

        rs = uSelect.executeQuery();
        rs.next();
        rs.updateDouble("F06", -Float.MAX_VALUE * 10.0);
        rs.updateRow();

        rs = plainSelect.executeQuery();
        rs.next();

        assertGetState(rs, "F06", XXX_FLOAT, "22003");
View Full Code Here

            }

            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

            }

            int nextId = rs.getInt(1);

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

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

        rs.updateInt(2, newCol2);
        assertEquals("Expected the resultset to be updated after updateInt",
                     newCol2, rs.getInt(2));
        assertTrue("Expected rs.rowUpdated() to be false before updateRow",
                   !rs.rowUpdated());
        rs.updateRow();
       
        assertTrue("Expected rs.rowUpdated() to be true after updateRow",
                   rs.rowUpdated());
        assertEquals("Expected the resultset detect the updates of previous " +
                     "updateRow", newCol2, rs.getInt(2));
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", newCol2, rs.getInt(2));
        rs.updateInt(3, newCol3);
        rs.updateRow();
        assertEquals("Expected the resultset to be updated after updateInt",
                     newCol3, rs.getInt(3));
        rs.cancelRowUpdates();
       
        assertEquals("Expected the resultset detect the updates of previous" +
View Full Code Here

        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());
        rs.updateRow();
       
        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));
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.