private void executeBatchAggregateSemiColon(Results results, final List<String> queries)
      throws SQLException {

    String firstSql = null;
    int currentIndex = 0;
    int totalQueries = queries.size();
    SQLException exception = null;

    do {

      try {

        firstSql = queries.get(currentIndex++);

        if (totalQueries == 1) {
          writer.startPacket(0);
          writer.write(COM_QUERY);
          writer.write(firstSql);
          writer.flush();
        } else {
          currentIndex = ComQuery
              .sendBatchAggregateSemiColon(writer, firstSql, queries, currentIndex);
        }
        getResult(results);

      } catch (SQLException sqlException) {
        if (exception == null) {
          exception = logQuery.exceptionWithQuery(firstSql, sqlException, explicitClosed);
          if (!options.continueBatchOnError) {
            throw exception;
          }
        }
      } catch (IOException e) {
        throw handleIoException(e);
      }
      stopIfInterrupted();

    } while (currentIndex < totalQueries);

    if (exception != null) {
      throw exception;
    }
  }
private void executeBatchAggregateSemiColon ( Results results , final List < String > queries ) throws SQLException { String firstSql = null ; int currentIndex = 0 ; int totalQueries = queries . size ( ) ; SQLException exception = null ; do { try { firstSql = queries . get ( currentIndex ++ ) ; if ( totalQueries == 1 ) { writer . startPacket ( 0 ) ; writer . write ( COM_QUERY ) ; writer . write ( firstSql ) ; writer . flush ( ) ; } else { currentIndex = ComQuery . sendBatchAggregateSemiColon ( writer , firstSql , queries , currentIndex ) ; } getResult ( results ) ; } catch ( SQLException sqlException ) { if ( exception == null ) { exception = logQuery . exceptionWithQuery ( firstSql , sqlException , explicitClosed ) ; if ( ! options . continueBatchOnError ) { throw exception ; } } } catch ( IOException e ) { throw handleIoException ( e ) ; } stopIfInterrupted ( ) ; } while ( currentIndex < totalQueries ) ; if ( exception != null ) { throw exception ; } }
Execute list of queries. This method is used when using text batch statement and using
rewriting (allowMultiQueries || rewriteBatchedStatements). queries will be send to server
according to max_allowed_packet size.

@param results result object
@param queries list of queries
@throws SQLException exception