Java SQL PreparedStatement getLimitedBatchSizePreparedStatement(PreparedStatement pstmt, int maxBatchSize)

Here you can find the source of getLimitedBatchSizePreparedStatement(PreparedStatement pstmt, int maxBatchSize)

Description

This method wraps the PreparedStatement given as argument into a delegate object that calls the executeBatch method every maxBatchSizeth time a batch is added to the statement with the addBatch method.

License

Open Source License

Parameter

Parameter Description
pstmt the prepared statement to wrap
maxBatchSize the maximum batch size at which an executeBatch should be called

Return

a PreparedStatement implementation that does automatic batch updates

Declaration

public static PreparedStatement getLimitedBatchSizePreparedStatement(PreparedStatement pstmt,
        int maxBatchSize) 

Method Source Code

//package com.java2s;

import java.sql.PreparedStatement;

public class Main {
    /**//from w w  w . j  a v  a  2 s  . c  o m
     * This method wraps the {@link PreparedStatement} given as argument
     * into a delegate object that calls the <code>executeBatch</code>
     * method every <code>maxBatchSize</code>th time a batch is added to
     * the statement with the <code>addBatch</code> method.
     *
     * @param pstmt the prepared statement to wrap
     * @param maxBatchSize the maximum batch size at which an executeBatch
     *       should be called
     * @return a PreparedStatement implementation that does automatic
     *       batch updates
     */
    public static PreparedStatement getLimitedBatchSizePreparedStatement(PreparedStatement pstmt,
            int maxBatchSize) {
        return null; // new LimitedBatchSizePreparedStatement(pstmt, maxBatchSize);
    }
}

Related

  1. getFileContent(final File file)
  2. getGeneratedKey(PreparedStatement ps)
  3. getGenerateKey(PreparedStatement stmt)
  4. getIdentity(PreparedStatement stat)
  5. getLastId(PreparedStatement s)
  6. getNewPreparedStatement(String format)
  7. getPreparedStatement(Connection conn, String sql)
  8. getPreparedStatement(Connection conn, String sql, List sqlParams, boolean getGeneratedKeys)
  9. getPreparedStatement(String sql)

  10. HOME | Copyright © www.java2s.com 2016