Class CmdInformationBatch
- java.lang.Object
-
- org.mariadb.jdbc.internal.com.read.dao.CmdInformationBatch
-
- All Implemented Interfaces:
CmdInformation
public class CmdInformationBatch extends Object implements CmdInformation
-
-
Field Summary
-
Fields inherited from interface org.mariadb.jdbc.internal.com.read.dao.CmdInformation
RESULT_SET_VALUE
-
-
Constructor Summary
Constructors Constructor Description CmdInformationBatch(int expectedSize, int autoIncrement)CmdInformationBatch is similar to CmdInformationMultiple, but knowing it's for batch, doesn't take take of moreResult.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddErrorStat()voidaddResultSetStat()voidaddSuccessStat(long updateCount, long insertId)ResultSetgetBatchGeneratedKeys(Protocol protocol)intgetCurrentStatNumber()ResultSetgetGeneratedKeys(Protocol protocol, String sql)Return GeneratedKeys containing insert ids.longgetLargeUpdateCount()long[]getLargeUpdateCounts()int[]getServerUpdateCounts()intgetUpdateCount()int[]getUpdateCounts()booleanisCurrentUpdateCount()booleanmoreResults()voidreset()Clear error state, used for clear exception after first batch query, when fall back to per-query execution.voidsetRewrite(boolean rewritten)
-
-
-
Constructor Detail
-
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 Detail
-
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
public ResultSet getBatchGeneratedKeys(Protocol protocol)
- Specified by:
getBatchGeneratedKeysin interfaceCmdInformation
-
getGeneratedKeys
public ResultSet getGeneratedKeys(Protocol protocol, String sql)
Return GeneratedKeys containing insert ids. Insert ids are calculated using autoincrement value.- Specified by:
getGeneratedKeysin interfaceCmdInformation- Parameters:
protocol- current protocolsql- SQL command- 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
-
-