public abstract class

AbstractInterruptibleBatchPreparedStatementSetter

extends Object
implements InterruptibleBatchPreparedStatementSetter
java.lang.Object
   ↳ org.springframework.jdbc.core.support.AbstractInterruptibleBatchPreparedStatementSetter

Class Overview

Abstract implementation of the InterruptibleBatchPreparedStatementSetter interface, combining the check for available values and setting of those into a single callback method setValuesIfAvailable(PreparedStatement, int).

Summary

Public Constructors
AbstractInterruptibleBatchPreparedStatementSetter()
Public Methods
int getBatchSize()
This implementation returns Integer.MAX_VALUE.
final boolean isBatchExhausted(int i)
This implementation return this instance's current exhaustion flag.
final void setValues(PreparedStatement ps, int i)
This implementation calls setValuesIfAvailable(PreparedStatement, int) and sets this instance's exhaustion flag accordingly.
Protected Methods
abstract boolean setValuesIfAvailable(PreparedStatement ps, int i)
Check for available values and set them on the given PreparedStatement.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.jdbc.core.BatchPreparedStatementSetter
From interface org.springframework.jdbc.core.InterruptibleBatchPreparedStatementSetter

Public Constructors

public AbstractInterruptibleBatchPreparedStatementSetter ()

Public Methods

public int getBatchSize ()

This implementation returns Integer.MAX_VALUE. Can be overridden in subclasses to lower the maximum batch size.

Returns
  • the number of statements in the batch

public final boolean isBatchExhausted (int i)

This implementation return this instance's current exhaustion flag.

Parameters
i index of the statement we're issuing in the batch, starting from 0
Returns
  • whether the batch is already exhausted

public final void setValues (PreparedStatement ps, int i)

This implementation calls setValuesIfAvailable(PreparedStatement, int) and sets this instance's exhaustion flag accordingly.

Parameters
ps the PreparedStatement to invoke setter methods on
i index of the statement we're issuing in the batch, starting from 0
Throws
SQLException

Protected Methods

protected abstract boolean setValuesIfAvailable (PreparedStatement ps, int i)

Check for available values and set them on the given PreparedStatement. If no values are available anymore, return false.

Parameters
ps PreparedStatement we'll invoke setter methods on
i index of the statement we're issuing in the batch, starting from 0
Returns
  • whether there were values to apply (that is, whether the applied parameters should be added to the batch and this method should be called for a further iteration)
Throws
SQLException if a SQLException is encountered (i.e. there is no need to catch SQLException)