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.InputStream
localInfileInputStream
private Parameters
parameters
private ClientParser
parser
private java.lang.String
preSqlCmd
-
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 int
batchUpdateLength()
Number of parameter rows, and so expected return lengthjava.lang.String
description()
Message descriptionint
encode(Writer encoder, Context context)
Encode client message to socket.void
ensureReplayable(Context context)
Ensure that command can be replayedjava.io.InputStream
getLocalInfileInputStream()
Get current local infile input stream.void
saveParameters()
Save parameters of command that can be re-executedboolean
validateLocalFileName(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:RedoableClientMessage
Ensure that command can be replayed- Specified by:
ensureReplayable
in 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:RedoableClientMessage
Save parameters of command that can be re-executed- Specified by:
saveParameters
in interfaceRedoableClientMessage
-
encode
public int encode(Writer encoder, Context context) throws java.io.IOException, java.sql.SQLException
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:
java.io.IOException
- if socket error occurjava.sql.SQLException
- 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
public boolean validateLocalFileName(java.lang.String fileName, Context context)
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
public java.io.InputStream getLocalInfileInputStream()
Description copied from interface:ClientMessage
Get current local infile input stream.- Specified by:
getLocalInfileInputStream
in interfaceClientMessage
- Returns:
- default to null
-
description
public java.lang.String description()
Description copied from interface:ClientMessage
Message description- Specified by:
description
in interfaceClientMessage
- Returns:
- description
-
-