Class PrepareExecutePacket
java.lang.Object
org.mariadb.jdbc.message.client.PrepareExecutePacket
- All Implemented Interfaces:
RedoableClientMessage, RedoableWithPrepareClientMessage, ClientMessage
Send a client COM_STMT_PREPARE + COM_STMT_EXECUTE packets see
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final InputStreamprivate Parametersprivate final ServerPreparedStatementprivate PrepareResultPacketprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionPrepareExecutePacket(String sql, Parameters parameters, ServerPreparedStatement prep, InputStream localInfileInputStream) Construct prepare packet -
Method Summary
Modifier and TypeMethodDescriptionintNumber of parameter rows, and so expected return lengthbooleanAre return value encoded in binary protocolbooleanCan skip metadataMessage descriptionintencoder method in case of failover, passing new prepared objectvoidensureReplayable(Context context) Ensure that command can be replayedsql command valueGet current local infile input stream.prep()Server prepare statement callerreadPacket(Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion, Reader reader, Writer writer, Context context, ExceptionFactory exceptionFactory, ClosableLock lock, boolean traceEnable, ClientMessage message, Consumer<String> redirectFct) default packet resultset parservoidSave parameters of command that can be re-executedvoidsetPrepareResult(PrepareResultPacket prepareResult) Set prepare result, if pipelining preparebooleanvalidateLocalFileName(String fileName, Context context) Request for local file to be validated from current query.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ClientMessage
mightBeBulkResultMethods inherited from interface RedoableWithPrepareClientMessage
encode, reEncode, rePrepare
-
Field Details
-
sql
-
prep
-
localInfileInputStream
-
prepareResult
-
parameters
-
-
Constructor Details
-
PrepareExecutePacket
public PrepareExecutePacket(String sql, Parameters parameters, ServerPreparedStatement prep, InputStream localInfileInputStream) Construct prepare packet- Parameters:
sql- sqlparameters- parameterprep- preparelocalInfileInputStream- local infile input stream
-
-
Method Details
-
encode
public int encode(Writer writer, Context context, Prepare newPrepareResult) throws IOException, 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:
IOException- if a socket exception occursSQLException- for any other kind of error
-
readPacket
public Completion readPacket(Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion, Reader reader, Writer writer, Context context, ExceptionFactory exceptionFactory, ClosableLock lock, boolean traceEnable, ClientMessage message, Consumer<String> redirectFct) throws IOException, SQLException Description copied from interface:ClientMessagedefault packet resultset parser- Specified by:
readPacketin interfaceClientMessage- Parameters:
stmt- callerfetchSize- fetch sizemaxRows- maximum number of rowsresultSetConcurrency- resultset concurrencyresultSetType- resultset typecloseOnCompletion- must close caller on result parsing endreader- packet readerwriter- packet writercontext- connection contextexceptionFactory- connection exception factorylock- thread safe lockstraceEnable- is logging trace enablemessage- client messageredirectFct- redirect consumer- Returns:
- results
- Throws:
IOException- if any socket error occursSQLException- for other kind of errors
-
saveParameters
public void saveParameters()Description copied from interface:RedoableClientMessageSave parameters of command that can be re-executed- Specified by:
saveParametersin interfaceRedoableClientMessage
-
ensureReplayable
Description copied from interface:RedoableClientMessageEnsure that command can be replayed- Specified by:
ensureReplayablein interfaceRedoableClientMessage- Parameters:
context- connection context- Throws:
IOException- If socket error occursSQLException- for other type of issue
-
canSkipMeta
public boolean canSkipMeta()Description copied from interface:ClientMessageCan skip metadata- Specified by:
canSkipMetain interfaceClientMessage- Returns:
- can skip metadata
-
description
Description copied from interface:ClientMessageMessage description- Specified by:
descriptionin interfaceClientMessage- Returns:
- description
-
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
Description copied from interface:RedoableWithPrepareClientMessagesql command value- Specified by:
getCommandin interfaceRedoableWithPrepareClientMessage- Returns:
- sql command
-
getLocalInfileInputStream
Description copied from interface:ClientMessageGet current local infile input stream.- Specified by:
getLocalInfileInputStreamin interfaceClientMessage- Returns:
- default to null
-
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
-
validateLocalFileName
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
Description copied from interface:RedoableWithPrepareClientMessageSet prepare result, if pipelining prepare- Specified by:
setPrepareResultin interfaceRedoableWithPrepareClientMessage- Parameters:
prepareResult- prepare results
-