Package java.sql

Examples of java.sql.ResultSet.moveToInsertRow()


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


    //DERBY-2966
    //Moving to insert row in a territory based db should not cause exception
    ps = conn.prepareStatement("SELECT * FROM CUSTOMER FOR UPDATE",
        ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
    rs = ps.executeQuery();
    rs.moveToInsertRow();
    rs.close();
    ps.close();
   
    //DERBY-2973
    //alter table modify column should not give an error
View Full Code Here

      Statement stmt1 = conn1.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
      ResultSet rs1 = stmt1.executeQuery("SELECT c1, c2 FROM testUpdateNCharacterStream");
      rs1.next();
      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();
View Full Code Here

      rs1.next();
      NClob nClob2 = conn1.createNClob();
      nClob2.setString(1, "bbb");
      rs1.updateNClob("c2", nClob2);
      rs1.updateRow();
      rs1.moveToInsertRow();
      rs1.updateString("c1", "2");
      NClob nClob3 = conn1.createNClob();
      nClob3.setString(1, "ccc");
      rs1.updateNClob("c2", nClob3);
      rs1.insertRow();
View Full Code Here

      Statement stmt1 = conn1.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
      ResultSet rs1 = stmt1.executeQuery("SELECT c1, c2 FROM testUpdateNString");
      rs1.next();
      rs1.updateNString("c2", "bbb");
      rs1.updateRow();
      rs1.moveToInsertRow();
      rs1.updateString("c1", "2");
      rs1.updateNString("c2", "ccc");
      rs1.insertRow();
      ResultSet rs2 = stmt1.executeQuery("SELECT c1, c2 FROM testUpdateNString");
      rs2.next();
View Full Code Here

            rs.updateRow();

            rs.absolute(11);
            rs.deleteRow();

            rs.moveToInsertRow();

            rs.updateInt(1, 1011);
            rs.updateString(2, "INSERT1011");
            rs.updateString(3, "0101");
View Full Code Here

      /* fill the resultset with some values */
      ResultSet updRs = updStmt
          .executeQuery("SELECT * FROM updateStreamTest");

      /* move to insertRow */
      updRs.moveToInsertRow();

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

View Full Code Here

        // Verify that inserts succeed and trigger the generation clause if they
        // just poke values into non-generated columns.
        //
        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
View Full Code Here

        // Verify that in-place inserts raise an exception if you try to poke a
        // value into a generated column.
        //
        rs = executeQuery( stmt, "select * from t_urs_1 for update" );
        rs.next();
        rs.moveToInsertRow();
        rs.updateInt( 2, 10 );
        expectInsertRowError( rs, CANT_OVERRIDE_GENERATION_CLAUSE );
        rs.close();
        conn.commit();
        assertResults
View Full Code Here

        Statement stmt = createStatement(ResultSet.TYPE_FORWARD_ONLY,
                ResultSet.CONCUR_UPDATABLE);
        stmt.setCursorName("my \"\"\"\"quoted\"\"\"\" cursor\"\"");
        rs = stmt.executeQuery("select * from \"my table\"");
        rs.next();
        rs.moveToInsertRow();
        rs.updateInt(1, 4);
        rs.insertRow();
        rs.moveToCurrentRow();
        rs.close();
       
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.