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 InputStream
private Parameters
private final ClientParser
private final String
-
Constructor Summary
ConstructorsConstructorDescriptionQueryWithParametersPacket
(String preSqlCmd, ClientParser parser, Parameters parameters, InputStream localInfileInputStream) Constructor -
Method Summary
Modifier and TypeMethodDescriptionint
Number of parameter rows, and so expected return lengthMessage descriptionint
Encode client message to socket.void
ensureReplayable
(Context context) Ensure that command can be replayedGet current local infile input stream.void
Save parameters of command that can be re-executedboolean
validateLocalFileName
(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
binaryProtocol, canSkipMeta, mightBeBulkResult, readPacket
Methods 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:RedoableClientMessage
Ensure that command can be replayed- Specified by:
ensureReplayable
in interfaceRedoableClientMessage
- Parameters:
context
- connection context- Throws:
IOException
- If socket error occursSQLException
- for other type of issue
-
saveParameters
public void saveParameters()Description copied from interface:RedoableClientMessage
Save parameters of command that can be re-executed- Specified by:
saveParameters
in interfaceRedoableClientMessage
-
encode
Description copied from interface:ClientMessage
Encode client message to socket.- Specified by:
encode
in 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:ClientMessage
Number of parameter rows, and so expected return length- Specified by:
batchUpdateLength
in interfaceClientMessage
- Returns:
- batch update length
-
validateLocalFileName
Description copied from interface:ClientMessage
Request for local file to be validated from current query.- Specified by:
validateLocalFileName
in 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:ClientMessage
Get current local infile input stream.- Specified by:
getLocalInfileInputStream
in interfaceClientMessage
- Returns:
- default to null
-
description
Description copied from interface:ClientMessage
Message description- Specified by:
description
in interfaceClientMessage
- Returns:
- description
-