Package java.sql

Examples of java.sql.ResultSet.insertRow()


        // Test that it is possible to insert a row and move back to current row
        rs.previous();
        currentPosition = rs.getRow();
        rs.moveToInsertRow();
        rs.updateInt(1, currentPosition + 1000);
        rs.insertRow();
        rs.moveToCurrentRow();
        assertEquals("CurrentPosition should be " + currentPosition,
                rs.getRow(), currentPosition);

       
View Full Code Here


        }
       
        try {
            rs.moveToCurrentRow();
            rs.updateInt(1, currentPosition + 2000);
            rs.insertRow();
        } catch (SQLException se) {
            assertEquals("Expected exception",
                    se.getSQLState().substring(0, 5),
                    CURSOR_NOT_POSITIONED_ON_INSERT_ROW);
        }
View Full Code Here

        assertTrue(rset.first());
        assertEquals(1, rset.getInt(1));
        rset.moveToInsertRow();
        rset.updateInt(1, 5);
        rset.updateString(2, "insert5");
        rset.insertRow();
        rset.moveToCurrentRow();
        assertEquals(1, rset.getInt(1));
        assertTrue(rset.last());
        assertEquals(5, rset.getInt(1));
View Full Code Here

         * becomes invisible to JdbcRowSet.
         */
        rset.moveToInsertRow();
        rset.updateInt(1, 6);
        rset.updateString(2, "insert6");
        rset.insertRow();
        rset.moveToCurrentRow();

        int index = 0;
        rset.beforeFirst();
        while (rset.next()) {
View Full Code Here

      /* update the table */
      updRs.updateBinaryStream("field1", new ByteArrayInputStream(
          streamData), streamLength);

      updRs.insertRow();
    } finally {
      this.stmt.executeUpdate("DROP TABLE IF EXISTS updateStreamTest");
    }
  }

View Full Code Here

      /* update the table */
      updRs.updateBinaryStream("field1", new ByteArrayInputStream(
          streamData), streamLength);

      updRs.insertRow();
    } finally {
      this.stmt.executeUpdate("DROP TABLE IF EXISTS updateStreamTest");
    }
  }

View Full Code Here

        // Insert a row
        rs.moveToInsertRow();
        rs.updateInt(1,42);
        rs.updateInt(2,42);
        rs.insertRow();

        // Delete a row
        rs.previous();
        rs.deleteRow();
View Full Code Here

        //
        rs = executeQuery( stmt, "select * from t_urs_1 for update" );
        rs.next();
        rs.moveToInsertRow();
        rs.updateInt( 1, 10 );
        rs.insertRow();
        rs.close();
        conn.commit();
        assertResults
            (
             conn,
View Full Code Here

        // Test updateBoolean() on various column types
        rs.moveToInsertRow();
        rs.updateBoolean("B", true); // Used to fail with client driver
        rs.updateBoolean("I", true);
        rs.updateBoolean("C", true);
        rs.insertRow();

        // Test updateObject() with a java.lang.Boolean on various column types
        rs.moveToInsertRow();
        rs.updateObject("B", Boolean.FALSE); // Used to fail with client driver
        rs.updateObject("I", Boolean.FALSE);
View Full Code Here

        // Test updateObject() with a java.lang.Boolean on various column types
        rs.moveToInsertRow();
        rs.updateObject("B", Boolean.FALSE); // Used to fail with client driver
        rs.updateObject("I", Boolean.FALSE);
        rs.updateObject("C", Boolean.FALSE);
        rs.insertRow();

        rs.close();

        JDBC.assertFullResultSet(
                s.executeQuery("select * from derby5042 order by 1,2,3"),
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.