Package java.sql

Examples of java.sql.CallableStatement.addBatch()


        cstmt.setInt(1,2)// Set id 2's value to -5 (should fail)
        cstmt.setInt(2,-5);
        cstmt.addBatch();
        cstmt.setInt(1,3)// Set id 3's value to 30.
        cstmt.setInt(2,30);
        cstmt.addBatch();
        cstmt.setInt(1,4)// Set id 4's value to 40.
        cstmt.setInt(2,40);
        cstmt.addBatch();

        int[] updateCount=null;
View Full Code Here


        cstmt.setInt(1,3)// Set id 3's value to 30.
        cstmt.setInt(2,30);
        cstmt.addBatch();
        cstmt.setInt(1,4)// Set id 4's value to 40.
        cstmt.setInt(2,40);
        cstmt.addBatch();

        int[] updateCount=null;

        try {
            updateCount = cstmt.executeBatch();
View Full Code Here

    try {
      cStmt = noProcedureBodiesConn
          .prepareCall("{CALL sp_testBug28689(?)}");
      cStmt.setInt(1, 1);
      cStmt.addBatch();
      cStmt.executeBatch();

      assertEquals(
          "BBBBBB",
          getSingleIndexedValueWithQuery(noProcedureBodiesConn, 1,
View Full Code Here

  }

  private void execProcBug49831(Connection c) throws Exception {
    CallableStatement cstmt = c.prepareCall("{call pTestBug49831(?)}");
    cstmt.setObject(1, "abc", Types.VARCHAR, 32);
    cstmt.addBatch();
    cstmt.setObject(1, "def", Types.VARCHAR, 32);
    cstmt.addBatch();
    cstmt.executeBatch();
    assertEquals(2, getRowCount("testBug49831"));
    this.rs = this.stmt
View Full Code Here

  private void execProcBug49831(Connection c) throws Exception {
    CallableStatement cstmt = c.prepareCall("{call pTestBug49831(?)}");
    cstmt.setObject(1, "abc", Types.VARCHAR, 32);
    cstmt.addBatch();
    cstmt.setObject(1, "def", Types.VARCHAR, 32);
    cstmt.addBatch();
    cstmt.executeBatch();
    assertEquals(2, getRowCount("testBug49831"));
    this.rs = this.stmt
        .executeQuery("SELECT * from testBug49831 ORDER BY VAL ASC");
    this.rs.next();
View Full Code Here

    try {
      int numBatches = 300;

      for (int i = 0; i < numBatches; i++) {
        storedProc.setInt(1, i + 1);
        storedProc.addBatch();
      }

      int[] counts = storedProc.executeBatch();

      assertEquals(numBatches, counts.length);
View Full Code Here

       
        CallableStatement cStmt = multiConn.prepareCall("{ CALL sp_rewriteErrors(?)}");
       
        for (int i = 0; i < 4096; i++) {
          cStmt.setInt(1, i);
          cStmt.addBatch();
        }
       
        cStmt.setInt(1, 2048);
        cStmt.addBatch();
       
View Full Code Here

          cStmt.setInt(1, i);
          cStmt.addBatch();
        }
       
        cStmt.setInt(1, 2048);
        cStmt.addBatch();
       
        try {
          cStmt.executeBatch();
        } catch (BatchUpdateException bUpE) {
          int[] counts = bUpE.getUpdateCounts();
View Full Code Here

        // Setup batch to modify value to 10 * the id (makes verification easy).
        CallableStatement cstmt = prepareCall("CALL BATCH_UPDATE_PROC(?,?)");
        cstmt.setInt(1,2)// Id 2's value will be updated to 20.
        cstmt.setInt(2,20);
        cstmt.addBatch();
        cstmt.setInt(1,3)// Id 3's value will be updated to 30.
        cstmt.setInt(2,30);
        cstmt.addBatch();
        cstmt.setInt(1,4)// Two rows will be updated to 40 for id 4.
        cstmt.setInt(2,40);
View Full Code Here

        cstmt.setInt(1,2)// Id 2's value will be updated to 20.
        cstmt.setInt(2,20);
        cstmt.addBatch();
        cstmt.setInt(1,3)// Id 3's value will be updated to 30.
        cstmt.setInt(2,30);
        cstmt.addBatch();
        cstmt.setInt(1,4)// Two rows will be updated to 40 for id 4.
        cstmt.setInt(2,40);
        cstmt.addBatch();
        cstmt.setInt(1,5)// No rows updated (no id 5).
        cstmt.setInt(2,50);
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.