Package org.mariadb.jdbc.message.client
Class ExecutePacket
- java.lang.Object
-
- org.mariadb.jdbc.message.client.ExecutePacket
-
- All Implemented Interfaces:
RedoableClientMessage,RedoableWithPrepareClientMessage,ClientMessage
public final class ExecutePacket extends java.lang.Object implements RedoableWithPrepareClientMessage
Execute command (COM_STMT_EXECUTE)- See Also:
- Execute documentation
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringcommandprivate java.io.InputStreamlocalInfileInputStreamprivate Parametersparametersprivate ServerPreparedStatementprepprivate PrepareprepareResult
-
Constructor Summary
Constructors Constructor Description ExecutePacket(Prepare prepareResult, Parameters parameters, java.lang.String command, ServerPreparedStatement prep, java.io.InputStream localInfileInputStream)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intbatchUpdateLength()Number of parameter rows, and so expected return lengthbooleanbinaryProtocol()Are return value encoded in binary protocolbooleancanSkipMeta()Can skip metadatajava.lang.Stringdescription()Message descriptionintencode(Writer writer, Context context, Prepare newPrepareResult)encoder method in case of failover, passing new prepared objectvoidensureReplayable(Context context)Ensure that command can be replayedjava.lang.StringgetCommand()sql command valuejava.io.InputStreamgetLocalInfileInputStream()Get current local infile input stream.ServerPreparedStatementprep()Server prepare statement callervoidsaveParameters()Save parameters of command that can be re-executedvoidsetPrepareResult(PrepareResultPacket prepareResult)Set prepare result, if pipelining preparebooleanvalidateLocalFileName(java.lang.String fileName, Context context)Request for local file to be validated from current query.-
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
mightBeBulkResult, readPacket
-
Methods inherited from interface org.mariadb.jdbc.message.client.RedoableWithPrepareClientMessage
encode, reEncode, rePrepare
-
-
-
-
Field Detail
-
command
private final java.lang.String command
-
prep
private final ServerPreparedStatement prep
-
localInfileInputStream
private final java.io.InputStream localInfileInputStream
-
prepareResult
private Prepare prepareResult
-
parameters
private Parameters parameters
-
-
Constructor Detail
-
ExecutePacket
public ExecutePacket(Prepare prepareResult, Parameters parameters, java.lang.String command, ServerPreparedStatement prep, java.io.InputStream localInfileInputStream)
Constructor- Parameters:
prepareResult- prepare resultparameters- parametercommand- sql commandprep- prepared statementlocalInfileInputStream- local infile input stream
-
-
Method Detail
-
saveParameters
public void saveParameters()
Description copied from interface:RedoableClientMessageSave parameters of command that can be re-executed- Specified by:
saveParametersin interfaceRedoableClientMessage
-
ensureReplayable
public void ensureReplayable(Context context) throws java.io.IOException, java.sql.SQLException
Description copied from interface:RedoableClientMessageEnsure that command can be replayed- Specified by:
ensureReplayablein interfaceRedoableClientMessage- Parameters:
context- connection context- Throws:
java.io.IOException- If socket error occursjava.sql.SQLException- for other type of issue
-
encode
public int encode(Writer writer, Context context, Prepare newPrepareResult) throws java.io.IOException, java.sql.SQLException
Description copied from interface:RedoableWithPrepareClientMessageencoder method in case of failover, passing new prepared object- Specified by:
encodein interfaceRedoableClientMessage- Specified by:
encodein interfaceRedoableWithPrepareClientMessage- Parameters:
writer- socket writercontext- connection contextnewPrepareResult- new prepare result- Returns:
- number of command sent
- Throws:
java.io.IOException- if a socket exception occursjava.sql.SQLException- for any other kind of error
-
canSkipMeta
public boolean canSkipMeta()
Description copied from interface:ClientMessageCan skip metadata- Specified by:
canSkipMetain interfaceClientMessage- Returns:
- can skip metadata
-
batchUpdateLength
public int batchUpdateLength()
Description copied from interface:ClientMessageNumber of parameter rows, and so expected return length- Specified by:
batchUpdateLengthin interfaceClientMessage- Returns:
- batch update length
-
getCommand
public java.lang.String getCommand()
Description copied from interface:RedoableWithPrepareClientMessagesql command value- Specified by:
getCommandin interfaceRedoableWithPrepareClientMessage- Returns:
- sql command
-
getLocalInfileInputStream
public java.io.InputStream getLocalInfileInputStream()
Description copied from interface:ClientMessageGet current local infile input stream.- Specified by:
getLocalInfileInputStreamin interfaceClientMessage- Returns:
- default to null
-
prep
public ServerPreparedStatement prep()
Description copied from interface:RedoableWithPrepareClientMessageServer prepare statement caller- Specified by:
prepin interfaceRedoableWithPrepareClientMessage- Returns:
- caller
-
binaryProtocol
public boolean binaryProtocol()
Description copied from interface:ClientMessageAre return value encoded in binary protocol- Specified by:
binaryProtocolin interfaceClientMessage- Returns:
- use binary protocol
-
description
public java.lang.String description()
Description copied from interface:ClientMessageMessage description- Specified by:
descriptionin interfaceClientMessage- Returns:
- description
-
validateLocalFileName
public boolean validateLocalFileName(java.lang.String fileName, Context context)Description copied from interface:ClientMessageRequest for local file to be validated from current query.- Specified by:
validateLocalFileNamein interfaceClientMessage- Parameters:
fileName- server file request pathcontext- current connection context- Returns:
- true if file name correspond to demand and query is a load local infile
-
setPrepareResult
public void setPrepareResult(PrepareResultPacket prepareResult)
Description copied from interface:RedoableWithPrepareClientMessageSet prepare result, if pipelining prepare- Specified by:
setPrepareResultin interfaceRedoableWithPrepareClientMessage- Parameters:
prepareResult- prepare results
-
-