Package org.mariadb.jdbc.message.client
Class BulkExecutePacket
- java.lang.Object
-
- org.mariadb.jdbc.message.client.BulkExecutePacket
-
- All Implemented Interfaces:
RedoableClientMessage
,RedoableWithPrepareClientMessage
,org.mariadb.jdbc.message.ClientMessage
public final class BulkExecutePacket extends Object implements RedoableWithPrepareClientMessage
batch execution. This relies on COM_STMT_BULK_EXECUTE see https://mariadb.com/kb/en/com_stmt_bulk_execute/
-
-
Constructor Summary
Constructors Constructor Description BulkExecutePacket(Prepare prepareResult, List<Parameters> batchParameterList, String command, ServerPreparedStatement prep)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
batchUpdateLength()
Number of parameter rows, and so expected return lengthboolean
binaryProtocol()
Are return value encoded in binary protocolString
description()
Message descriptionint
encode(Writer writer, org.mariadb.jdbc.client.Context context, Prepare newPrepareResult)
encoder method in case of failover, passing new prepared objectString
getCommand()
sql command valueServerPreparedStatement
prep()
Server prepare statement callervoid
saveParameters()
Save parameters of command that can be re-executedvoid
setPrepareResult(PrepareResultPacket prepareResult)
Set prepare result, if pipelining prepare-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.mariadb.jdbc.message.ClientMessage
canSkipMeta, readPacket, validateLocalFileName
-
Methods inherited from interface org.mariadb.jdbc.message.client.RedoableClientMessage
ensureReplayable
-
Methods inherited from interface org.mariadb.jdbc.message.client.RedoableWithPrepareClientMessage
encode, reEncode, rePrepare
-
-
-
-
Constructor Detail
-
BulkExecutePacket
public BulkExecutePacket(Prepare prepareResult, List<Parameters> batchParameterList, String command, ServerPreparedStatement prep)
Constructor- Parameters:
prepareResult
- prepare resultbatchParameterList
- batch parameter listcommand
- sql commandprep
- object creator
-
-
Method Detail
-
saveParameters
public void saveParameters()
Description copied from interface:RedoableClientMessage
Save parameters of command that can be re-executed- Specified by:
saveParameters
in interfaceRedoableClientMessage
-
encode
public int encode(Writer writer, org.mariadb.jdbc.client.Context context, Prepare newPrepareResult) throws IOException, SQLException
Description copied from interface:RedoableWithPrepareClientMessage
encoder method in case of failover, passing new prepared object- Specified by:
encode
in interfaceRedoableClientMessage
- Specified by:
encode
in interfaceRedoableWithPrepareClientMessage
- Parameters:
writer
- socket writercontext
- connection contextnewPrepareResult
- new prepare result- Returns:
- number of command sent
- Throws:
IOException
- if a socket exception occursSQLException
- for any other kind of error
-
batchUpdateLength
public int batchUpdateLength()
Description copied from interface:org.mariadb.jdbc.message.ClientMessage
Number of parameter rows, and so expected return length- Specified by:
batchUpdateLength
in interfaceorg.mariadb.jdbc.message.ClientMessage
- Returns:
- batch update length
-
getCommand
public String getCommand()
Description copied from interface:RedoableWithPrepareClientMessage
sql command value- Specified by:
getCommand
in interfaceRedoableWithPrepareClientMessage
- Returns:
- sql command
-
prep
public ServerPreparedStatement prep()
Description copied from interface:RedoableWithPrepareClientMessage
Server prepare statement caller- Specified by:
prep
in interfaceRedoableWithPrepareClientMessage
- Returns:
- caller
-
binaryProtocol
public boolean binaryProtocol()
Description copied from interface:org.mariadb.jdbc.message.ClientMessage
Are return value encoded in binary protocol- Specified by:
binaryProtocol
in interfaceorg.mariadb.jdbc.message.ClientMessage
- Returns:
- use binary protocol
-
description
public String description()
Description copied from interface:org.mariadb.jdbc.message.ClientMessage
Message description- Specified by:
description
in interfaceorg.mariadb.jdbc.message.ClientMessage
- Returns:
- description
-
setPrepareResult
public void setPrepareResult(PrepareResultPacket prepareResult)
Description copied from interface:RedoableWithPrepareClientMessage
Set prepare result, if pipelining prepare- Specified by:
setPrepareResult
in interfaceRedoableWithPrepareClientMessage
- Parameters:
prepareResult
- prepare results
-
-