Class CmdInformationBatch
java.lang.Object
org.mariadb.jdbc.internal.com.read.dao.CmdInformationBatch
- All Implemented Interfaces:
CmdInformation
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final intprivate booleanprivate intprivate booleanFields inherited from interface org.mariadb.jdbc.internal.com.read.dao.CmdInformation
RESULT_SET_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionCmdInformationBatch(int expectedSize, int autoIncrement) CmdInformationBatch is similar to CmdInformationMultiple, but knowing it's for batch, doesn't take take of moreResult. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidaddSuccessStat(long updateCount, long insertId) getBatchGeneratedKeys(Protocol protocol) intgetGeneratedKeys(Protocol protocol) Return GeneratedKeys containing insert ids.longlong[]int[]intint[]booleanbooleanvoidreset()Clear error state, used for clear exception after first batch query, when fall back to per-query execution.voidsetRewrite(boolean rewritten)
-
Field Details
-
insertIds
-
updateCounts
-
expectedSize
private final int expectedSize -
autoIncrement
private final int autoIncrement -
insertIdNumber
private int insertIdNumber -
hasException
private boolean hasException -
rewritten
private boolean rewritten
-
-
Constructor Details
-
CmdInformationBatch
public CmdInformationBatch(int expectedSize, int autoIncrement) CmdInformationBatch is similar to CmdInformationMultiple, but knowing it's for batch, doesn't take take of moreResult. That permit to use ConcurrentLinkedQueue, and then when option "useBatchMultiSend" is set and batch is interrupted, will permit to reading thread to keep connection in a correct state without any ConcurrentModificationException.- Parameters:
expectedSize- expected batch size.autoIncrement- connection auto increment value.
-
-
Method Details
-
addErrorStat
public void addErrorStat()- Specified by:
addErrorStatin interfaceCmdInformation
-
reset
public void reset()Clear error state, used for clear exception after first batch query, when fall back to per-query execution.- Specified by:
resetin interfaceCmdInformation
-
addResultSetStat
public void addResultSetStat()- Specified by:
addResultSetStatin interfaceCmdInformation
-
addSuccessStat
public void addSuccessStat(long updateCount, long insertId) - Specified by:
addSuccessStatin interfaceCmdInformation
-
getUpdateCounts
public int[] getUpdateCounts()- Specified by:
getUpdateCountsin interfaceCmdInformation
-
getServerUpdateCounts
public int[] getServerUpdateCounts()- Specified by:
getServerUpdateCountsin interfaceCmdInformation
-
getLargeUpdateCounts
public long[] getLargeUpdateCounts()- Specified by:
getLargeUpdateCountsin interfaceCmdInformation
-
getUpdateCount
public int getUpdateCount()- Specified by:
getUpdateCountin interfaceCmdInformation
-
getLargeUpdateCount
public long getLargeUpdateCount()- Specified by:
getLargeUpdateCountin interfaceCmdInformation
-
getBatchGeneratedKeys
- Specified by:
getBatchGeneratedKeysin interfaceCmdInformation
-
getGeneratedKeys
Return GeneratedKeys containing insert ids. Insert ids are calculated using autoincrement value.- Specified by:
getGeneratedKeysin interfaceCmdInformation- Parameters:
protocol- current protocol- Returns:
- a resultSet with insert ids.
-
getCurrentStatNumber
public int getCurrentStatNumber()- Specified by:
getCurrentStatNumberin interfaceCmdInformation
-
moreResults
public boolean moreResults()- Specified by:
moreResultsin interfaceCmdInformation
-
isCurrentUpdateCount
public boolean isCurrentUpdateCount()- Specified by:
isCurrentUpdateCountin interfaceCmdInformation
-
setRewrite
public void setRewrite(boolean rewritten) - Specified by:
setRewritein interfaceCmdInformation
-