Package java.sql

Examples of java.sql.PreparedStatement.executeBatch()


        try {
          final PreparedStatement statement = entry.getValue();
          final int[] rowCounts;
          try {
            transactionContext().startBatchExecution();
            rowCounts = statement.executeBatch();
          }
          finally {
            transactionContext().endBatchExecution();
          }
          checkRowCounts( rowCounts, statement );
View Full Code Here


            // add statement to batch
            insertNode.addBatch();

            if (++batchSize == MAXIMUM_BATCH_SIZE)
            {
               insertNode.executeBatch();

               commitBatch();

               batchSize = 0;
            }
View Full Code Here

            }
         }

         if (batchSize != 0)
         {
            insertNode.executeBatch();

            commitBatch();
         }
      }
      finally
View Full Code Here

            {
               ps.addBatch();
               batchCaount++;
               if (batchCaount >= config.getBatchSize())
               {
                  int result[] = ps.executeBatch();
                  for (int aResult : result)
                  {
                     if (aResult != 1 /* one and only one row must have been updated */
                           && aResult != Statement.SUCCESS_NO_INFO)
                     {
View Full Code Here

         {
            if (batchCaount > config.getBatchSize())
            {
               throw new IllegalStateException("batchCaount > config.getBatchSize() should never happen!");
            }
            ps.executeBatch();//flush the batch here
         }
      }
      finally
      {
         lock.releaseLock(subtree);
View Full Code Here

                  ps.setLong(2, bucket.timestampOfFirstEntryToExpire());
                  ps.setString(3, bucket.getBucketIdAsString());
                  ps.addBatch();
                  updateCount++;
                  if (updateCount % batchSize == 0) {
                     ps.executeBatch();
                     if (log.isTraceEnabled()) {
                        log.tracef("Flushing batch, update count is: %d", updateCount);
                     }
                  }
               } else {
View Full Code Here

            // flush the batch
            if (updateCount % batchSize != 0) {
               if (log.isTraceEnabled()) {
                  log.tracef("Flushing batch, update count is: %d", updateCount);
               }
               ps.executeBatch();
            }
            if (log.isTraceEnabled()) {
               log.tracef("Updated %d buckets.", updateCount);
            }
         } catch (InterruptedException ie) {
View Full Code Here

               deletionCount++;
               if (deletionCount % batchSize == 0) {
                  if (log.isTraceEnabled()) {
                     log.tracef("Flushing deletion batch, total deletion count so far is %d", deletionCount);
                  }
                  ps.executeBatch();
               }
            }
            if (deletionCount % batchSize != 0) {
               int[] batchResult = ps.executeBatch();
               if (log.isTraceEnabled()) {
View Full Code Here

                  }
                  ps.executeBatch();
               }
            }
            if (deletionCount % batchSize != 0) {
               int[] batchResult = ps.executeBatch();
               if (log.isTraceEnabled()) {
                  log.tracef("Flushed the batch and received following results: %s", Arrays.toString(batchResult));
               }
            }
         } catch (Exception ex) {
View Full Code Here

         Object objFromStream = marshaller.objectFromObjectStream(objectInput);
         while (fromStreamProcess(objFromStream, ps, objectInput)) {
            ps.addBatch();
            readCount++;
            if (readCount % batchSize == 0) {
               ps.executeBatch();
               if (log.isTraceEnabled()) {
                  log.trace("Executing batch " + readCount / batchSize + ", batch size is " + batchSize);
               }
            }
            objFromStream = marshaller.objectFromObjectStream(objectInput);
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.