Package java.sql

Examples of java.sql.ResultSet.updateRow()


        assertEquals("Expected one row to be updated", 1,
                     ps.executeUpdate());
       
        rs.updateInt(1, -555);
        rs.updateInt(3, -777);
        rs.updateRow();
       
        PreparedStatement ps2 =
            prepareStatement("select * from t1 where a=?");
        ps2.setInt(1, -indexedKey);
        ResultSet rs2 = ps2.executeQuery();
View Full Code Here


                                           ResultSet.CONCUR_UPDATABLE);
        s.setCursorName(getNextCursorName());
        ResultSet rs = s.executeQuery("select a,b from t1");
        rs.next();
        rs.updateInt(1, rs.getInt(1) + 2 * recordCount);
        rs.updateRow();
        assertTrue("Expected rowUpdated() to return true", rs.rowUpdated());
        rs.deleteRow();
        rs.next();
        rs.previous();
        assertTrue("Expected rowUpdated() to return true", rs.rowUpdated());
View Full Code Here

        rs.moveToInsertRow();
        checkDetectabilityCallsOutsideRow(rs, "on FO insertRow");

        rs.next();
        rs.updateInt(2, 666);
        rs.updateRow();
        checkDetectabilityCallsOutsideRow(rs, "after FO updateRow");

        rs.next();
        rs.deleteRow();
        checkDetectabilityCallsOutsideRow(rs, "after FO deleteRow");
View Full Code Here

            Blob blob = res.getBlob(1);
            OutputStream os = blob.setBinaryStream(1);
            copy(is, os);
            os.close();
            res.updateBlob(1, blob);
            res.updateRow();

        } catch (IOException ioe) {
            throw new StoreException(ioe);
        } finally {
            if (res != null)
View Full Code Here

            Clob clob = res.getClob(1);
            Writer writer = clob.setCharacterStream(1);
            copy(reader, writer);
            writer.close();
            res.updateClob(1, clob);
            res.updateRow();

        } catch (IOException ioe) {
            throw new StoreException(ioe);
        } finally {
            if (res != null)
View Full Code Here

                        if (Strings.isBlank(strategyId)) {
                            resultSet.updateString(Columns.STRATEGY_ID, UsernameActivationStrategy.ID);
                        }

                        // perform the update
                        resultSet.updateRow();

                    }

                }
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

          else if (v instanceof Long)
            rs.updateLong(idx++, (Long) v);
          else
            throw new Error("Unknown value type " + v.getClass() + " (" + v + ")");
        }
        rs.updateRow();
      }
    } finally {
      rs.close();
    }
  }
View Full Code Here

            writer.write(expected);
            writer.close();
            */
            blob.setBytes(1, expected.getBytes());
           
            results.updateRow();
            Assert.assertFalse(results.next());
            c.commit();
            blob.free();
          }
          finally
View Full Code Here

                ps.executeUpdate();               
                fail("Expected exception to be thrown on positioned update " +
                     "since cursor is not positioned");
            } else {
                rs.updateInt(1, -1);
                rs.updateRow();
                fail("Expected exception to be thrown on updateRow() since " +
                     "cursor is not positioned");
            }
        } catch (SQLException e) {
            assertSQLState("Unexpected SQLState when updating row after commit",
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.