Package org.mariadb.jdbc.message.client

## Class QueryPacket

- java.lang.Object
- - org.mariadb.jdbc.message.client.QueryPacket

All Implemented Interfaces:
  `RedoableClientMessage`, `org.mariadb.jdbc.message.ClientMessage`

    public final class QueryPacket
    extends Object
    implements RedoableClientMessage

Query client packet COM_QUERY see https://mariadb.com/kb/en/com_query/

### Constructor Summary

Constructors
`QueryPacket​(String sql)` Constructor

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `batchUpdateLength()` Number of parameter rows, and so expected return length
`String` `description()` Message description
`int` `encode​(Writer writer, org.mariadb.jdbc.client.Context context)` Encode client message to socket.
`boolean` `isCommit()` Check that command is a COMMIT command
`boolean` `validateLocalFileName​(String fileName, org.mariadb.jdbc.client.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, readPacket`

### Methods inherited from interface org.mariadb.jdbc.message.client.RedoableClientMessage

`encode, ensureReplayable, reEncode, saveParameters`

### Constructor Detail

#### QueryPacket

    public QueryPacket​(String sql)

Constructor

Parameters:
  `sql` - sql command

### Method Detail

#### batchUpdateLength

    public int batchUpdateLength()

Description copied from interface: `org.mariadb.jdbc.message.ClientMessage`
Number of parameter rows, and so expected return length

Specified by:
  `batchUpdateLength` in interface `org.mariadb.jdbc.message.ClientMessage`
Returns:
  batch update length

#### encode

    public int encode​(Writer writer,
                      org.mariadb.jdbc.client.Context context)
               throws IOException

Description copied from interface: `org.mariadb.jdbc.message.ClientMessage`
Encode client message to socket.

Specified by:
  `encode` in interface `org.mariadb.jdbc.message.ClientMessage`
Parameters:
  `writer` - socket writer
  `context` - connection context
Returns:
  number of client message written
Throws:
  `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​(String fileName,
                                         org.mariadb.jdbc.client.Context context)

Description copied from interface: `org.mariadb.jdbc.message.ClientMessage`
Request for local file to be validated from current query.

Specified by:
  `validateLocalFileName` in interface `org.mariadb.jdbc.message.ClientMessage`
Parameters:
  `fileName` - server file request path
  `context` - current connection context
Returns:
  true if file name correspond to demand and query is a load local infile

#### description

    public String description()

Description copied from interface: `org.mariadb.jdbc.message.ClientMessage`
Message description

Specified by:
  `description` in interface `org.mariadb.jdbc.message.ClientMessage`
Returns:
  description