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


        //
        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

        rs.moveToInsertRow();
        rs.updateInt("EMPLOYEEID", 666);
        rs.updateInt("CATEGORY", 667);
        rs.updateDouble("SALARY", 666.0);
        rs.updateString("NAME", "N.N.");
        rs.insertRow();
        rs.close();

        rs = cStmt.executeQuery(
            "select * from s1.wages where name = 'N.N.'");
        rs.next();
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

        // 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

      /* 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

                for (int i = 0; i < rs.getMetaData().getColumnCount(); i++) {
                    String x = attributes.getProperty("r" + row + "c" + (i + 1));
                    unescapeData(x, rs, i + 1);
                }
                if (insert) {
                    rs.insertRow();
                } else {
                    rs.updateRow();
                }
            } else if (op == 2) {
                rs.absolute(row);
View Full Code Here

      rs1.updateNCharacterStream("c2", new StringReader("bbb"), 3);
      rs1.updateRow();
      rs1.moveToInsertRow();
      rs1.updateString("c1", "2");
      rs1.updateNCharacterStream("c2", new StringReader("ccc"), 3);
      rs1.insertRow();
      ResultSet rs2 = stmt1.executeQuery("SELECT c1, c2 FROM testUpdateNCharacterStream");
      rs2.next();
      assertEquals("1", rs2.getString("c1"));
      assertEquals("bbb", rs2.getNString("c2"));
      rs2.next();
View Full Code Here

      rs1.moveToInsertRow();
      rs1.updateString("c1", "2");
      NClob nClob3 = conn1.createNClob();
      nClob3.setString(1, "ccc");
      rs1.updateNClob("c2", nClob3);
      rs1.insertRow();
      ResultSet rs2 = stmt1.executeQuery("SELECT c1, c2 FROM testUpdateNChlob");
      rs2.next();
      assertEquals("1", rs2.getString("c1"));
      assertEquals("bbb", rs2.getNString("c2"));
      rs2.next();
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.