1 16 17 package org.springframework.jdbc.core.support; 18 19 import java.sql.PreparedStatement ; 20 import java.sql.SQLException ; 21 22 import org.springframework.jdbc.core.InterruptibleBatchPreparedStatementSetter; 23 24 33 public abstract class AbstractInterruptibleBatchPreparedStatementSetter 34 implements InterruptibleBatchPreparedStatementSetter { 35 36 private boolean exhausted; 37 38 39 43 public final void setValues(PreparedStatement ps, int i) throws SQLException { 44 this.exhausted = !setValuesIfAvailable(ps, i); 45 } 46 47 50 public final boolean isBatchExhausted(int i) { 51 return this.exhausted; 52 } 53 54 58 public int getBatchSize() { 59 return Integer.MAX_VALUE; 60 } 61 62 63 73 protected abstract boolean setValuesIfAvailable(PreparedStatement ps, int i) throws SQLException ; 74 75 } 76 | Popular Tags |