Package org.mariadb.jdbc.message.client
Class QueryPacket
- java.lang.Object
-
- org.mariadb.jdbc.message.client.QueryPacket
-
- All Implemented Interfaces:
RedoableClientMessage
,ClientMessage
public final class QueryPacket extends java.lang.Object implements RedoableClientMessage
Query client packet COM_QUERY see https://mariadb.com/kb/en/com_query/
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.InputStream
localInfileInputStream
private java.lang.String
sql
-
Constructor Summary
Constructors Constructor Description QueryPacket(java.lang.String sql)
ConstructorQueryPacket(java.lang.String sql, java.io.InputStream localInfileInputStream)
Constructor with local infile input stream
-
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 writer, Context context)
Encode client message to socket.java.io.InputStream
getLocalInfileInputStream()
Get current local infile input stream.boolean
isCommit()
Check that command is a COMMIT commandboolean
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, ensureReplayable, reEncode, saveParameters
-
-
-
-
Constructor Detail
-
QueryPacket
public QueryPacket(java.lang.String sql)
Constructor- Parameters:
sql
- sql command
-
QueryPacket
public QueryPacket(java.lang.String sql, java.io.InputStream localInfileInputStream)
Constructor with local infile input stream- Parameters:
sql
- sqllocalInfileInputStream
- local infile input stream
-
-
Method Detail
-
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
-
encode
public int encode(Writer writer, Context context) throws java.io.IOException
Description copied from interface:ClientMessage
Encode client message to socket.- Specified by:
encode
in interfaceClientMessage
- Parameters:
writer
- socket writercontext
- connection context- Returns:
- number of client message written
- Throws:
java.io.IOException
- if socket error occur
-
isCommit
public boolean isCommit()
Check that command is a COMMIT command- Returns:
- true if a commit command
-
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
-
-