Package org.mariadb.jdbc.message.client

## Class ExecutePacket

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

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

    public final class ExecutePacket
    extends Object
    implements RedoableWithPrepareClientMessage

Execute command (COM_STMT_EXECUTE) See https://mariadb.com/kb/en/com_stmt_execute/ for documentation

### Constructor Summary

Constructors
`ExecutePacket​(Prepare prepareResult, Parameters parameters, String command, ServerPreparedStatement prep, InputStream localInfileInputStream)` Constructor

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `batchUpdateLength()` Number of parameter rows, and so expected return length
`boolean` `binaryProtocol()` Are return value encoded in binary protocol
`boolean` `canSkipMeta()` Can skip metadata
`String` `description()` Message description
`int` `encode​(Writer writer, org.mariadb.jdbc.client.Context context, Prepare newPrepareResult)` encoder method in case of failover, passing new prepared object
`void` `ensureReplayable​(org.mariadb.jdbc.client.Context context)` Ensure that command can be replayed
`String` `getCommand()` sql command value
`InputStream` `getLocalInfileInputStream()`
`ServerPreparedStatement` `prep()` Server prepare statement caller
`void` `saveParameters()` Save parameters of command that can be re-executed
`void` `setPrepareResult​(PrepareResultPacket prepareResult)` Set prepare result, if pipelining prepare
`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

`readPacket`

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

`encode, reEncode, rePrepare`

### Constructor Detail

#### ExecutePacket

    public ExecutePacket​(Prepare prepareResult,
                         Parameters parameters,
                         String command,
                         ServerPreparedStatement prep,
                         InputStream localInfileInputStream)

Constructor

Parameters:
  `prepareResult` - prepare result
  `parameters` - parameter
  `command` - sql command
  `prep` - prepared statement

### Method Detail

#### saveParameters

    public void saveParameters()

Description copied from interface: `RedoableClientMessage`
Save parameters of command that can be re-executed

Specified by:
  `saveParameters` in interface `RedoableClientMessage`

#### ensureReplayable

    public void ensureReplayable​(org.mariadb.jdbc.client.Context context)
                          throws IOException,
                                 SQLException

Description copied from interface: `RedoableClientMessage`
Ensure that command can be replayed

Specified by:
  `ensureReplayable` in interface `RedoableClientMessage`
Parameters:
  `context` - connection context
Throws:
  `IOException` - If socket error occurs
  `SQLException` - for other type of issue

#### encode

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

Description copied from interface: `RedoableWithPrepareClientMessage`
encoder method in case of failover, passing new prepared object

Specified by:
  `encode` in interface `RedoableClientMessage`
Specified by:
  `encode` in interface `RedoableWithPrepareClientMessage`
Parameters:
  `writer` - socket writer
  `context` - connection context
  `newPrepareResult` - new prepare result
Returns:
  number of command sent
Throws:
  `IOException` - if a socket exception occurs
  `SQLException` - for any other kind of error

#### canSkipMeta

    public boolean canSkipMeta()

Description copied from interface: `org.mariadb.jdbc.message.ClientMessage`
Can skip metadata

Specified by:
  `canSkipMeta` in interface `org.mariadb.jdbc.message.ClientMessage`
Returns:
  can skip metadata

#### 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

#### getCommand

    public String getCommand()

Description copied from interface: `RedoableWithPrepareClientMessage`
sql command value

Specified by:
  `getCommand` in interface `RedoableWithPrepareClientMessage`
Returns:
  sql command

#### getLocalInfileInputStream

    public InputStream getLocalInfileInputStream()

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

#### prep

    public ServerPreparedStatement prep()

Description copied from interface: `RedoableWithPrepareClientMessage`
Server prepare statement caller

Specified by:
  `prep` in interface `RedoableWithPrepareClientMessage`
Returns:
  caller

#### binaryProtocol

    public boolean binaryProtocol()

Description copied from interface: `org.mariadb.jdbc.message.ClientMessage`
Are return value encoded in binary protocol

Specified by:
  `binaryProtocol` in interface `org.mariadb.jdbc.message.ClientMessage`
Returns:
  use binary protocol

#### 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

#### 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

#### setPrepareResult

    public void setPrepareResult​(PrepareResultPacket prepareResult)

Description copied from interface: `RedoableWithPrepareClientMessage`
Set prepare result, if pipelining prepare

Specified by:
  `setPrepareResult` in interface `RedoableWithPrepareClientMessage`
Parameters:
  `prepareResult` - prepare results