Package org.mariadb.jdbc.message.client
Class QueryWithParametersPacket
- java.lang.Object
-
- org.mariadb.jdbc.message.client.QueryWithParametersPacket
-
- All Implemented Interfaces:
RedoableClientMessage,ClientMessage
public final class QueryWithParametersPacket extends java.lang.Object implements RedoableClientMessage
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
Fields Modifier and Type Field Description private java.io.InputStreamlocalInfileInputStreamprivate Parametersparametersprivate ClientParserparserprivate java.lang.StringpreSqlCmd
-
Constructor Summary
Constructors Constructor Description QueryWithParametersPacket(java.lang.String preSqlCmd, ClientParser parser, Parameters parameters, 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 lengthjava.lang.Stringdescription()Message descriptionintencode(Writer encoder, Context context)Encode client message to socket.voidensureReplayable(Context context)Ensure that command can be replayedjava.io.InputStreamgetLocalInfileInputStream()Get current local infile input stream.voidsaveParameters()Save parameters of command that can be re-executedbooleanvalidateLocalFileName(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
binaryProtocol, canSkipMeta, mightBeBulkResult, readPacket
-
Methods inherited from interface org.mariadb.jdbc.message.client.RedoableClientMessage
encode, reEncode
-
-
-
-
Field Detail
-
preSqlCmd
private final java.lang.String preSqlCmd
-
parser
private final ClientParser parser
-
localInfileInputStream
private final java.io.InputStream localInfileInputStream
-
parameters
private Parameters parameters
-
-
Constructor Detail
-
QueryWithParametersPacket
public QueryWithParametersPacket(java.lang.String preSqlCmd, ClientParser parser, Parameters parameters, java.io.InputStream localInfileInputStream)Constructor- Parameters:
preSqlCmd- additional pre commandparser- command parser resultparameters- parameterslocalInfileInputStream- local infile input stream
-
-
Method Detail
-
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
-
saveParameters
public void saveParameters()
Description copied from interface:RedoableClientMessageSave parameters of command that can be re-executed- Specified by:
saveParametersin interfaceRedoableClientMessage
-
encode
public int encode(Writer encoder, Context context) throws java.io.IOException, java.sql.SQLException
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:
java.io.IOException- if socket error occurjava.sql.SQLException- 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
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
-
getLocalInfileInputStream
public java.io.InputStream getLocalInfileInputStream()
Description copied from interface:ClientMessageGet current local infile input stream.- Specified by:
getLocalInfileInputStreamin interfaceClientMessage- Returns:
- default to null
-
description
public java.lang.String description()
Description copied from interface:ClientMessageMessage description- Specified by:
descriptionin interfaceClientMessage- Returns:
- description
-
-