Package org.mariadb.jdbc.message.client
Class QueryWithParametersPacket
java.lang.Object
org.mariadb.jdbc.message.client.QueryWithParametersPacket
- All Implemented Interfaces:
RedoableClientMessage,ClientMessage
Query client packet COM_QUERY see https://mariadb.com/kb/en/com_query/ same than QueryPacket, but
with parameters that will be escaped
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final InputStreamprivate Parametersprivate final ClientParserprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionQueryWithParametersPacket(String preSqlCmd, ClientParser parser, Parameters parameters, InputStream localInfileInputStream) Constructor -
Method Summary
Modifier and TypeMethodDescriptionintNumber of parameter rows, and so expected return lengthMessage descriptionintEncode client message to socket.voidensureReplayable(Context context) Ensure that command can be replayedGet current local infile input stream.voidSave parameters of command that can be re-executedbooleanvalidateLocalFileName(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, waitMethods inherited from interface org.mariadb.jdbc.message.ClientMessage
binaryProtocol, canSkipMeta, mightBeBulkResult, readPacketMethods inherited from interface org.mariadb.jdbc.message.client.RedoableClientMessage
encode, reEncode
-
Field Details
-
preSqlCmd
-
parser
-
localInfileInputStream
-
parameters
-
-
Constructor Details
-
QueryWithParametersPacket
public QueryWithParametersPacket(String preSqlCmd, ClientParser parser, Parameters parameters, InputStream localInfileInputStream) Constructor- Parameters:
preSqlCmd- additional pre commandparser- command parser resultparameters- parameterslocalInfileInputStream- local infile input stream
-
-
Method Details
-
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
-
saveParameters
public void saveParameters()Description copied from interface:RedoableClientMessageSave parameters of command that can be re-executed- Specified by:
saveParametersin interfaceRedoableClientMessage
-
encode
Description copied from interface:ClientMessageEncode client message to socket.- Specified by:
encodein interfaceClientMessage- Parameters:
encoder- socket writercontext- connection context- Returns:
- number of client message written
- Throws:
IOException- if socket error occurSQLException- if any issue occurs
-
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
-
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
-
getLocalInfileInputStream
Description copied from interface:ClientMessageGet current local infile input stream.- Specified by:
getLocalInfileInputStreamin interfaceClientMessage- Returns:
- default to null
-
description
Description copied from interface:ClientMessageMessage description- Specified by:
descriptionin interfaceClientMessage- Returns:
- description
-