Package org.mariadb.jdbc.message.server

## Class PrepareResultPacket

- java.lang.Object
- - org.mariadb.jdbc.message.server.PrepareResultPacket

All Implemented Interfaces:
  `org.mariadb.jdbc.client.Completion`, `Prepare`, `org.mariadb.jdbc.message.ServerMessage`

Direct Known Subclasses:
  `CachedPrepareResultPacket`

    public class PrepareResultPacket
    extends Object
    implements org.mariadb.jdbc.client.Completion, Prepare

Prepare result packet See https://mariadb.com/kb/en/com_stmt_prepare/#COM_STMT_PREPARE_OK

### Field Summary

Fields
`protected int` `statementId` prepare statement id

### Constructor Summary

Constructors
`PrepareResultPacket​(org.mariadb.jdbc.client.ReadableByteBuf buffer, Reader reader, org.mariadb.jdbc.client.Context context)` Prepare packet constructor (parsing)

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close​(org.mariadb.jdbc.client.Client con)` Close prepare packet
`void` `decrementUse​(org.mariadb.jdbc.client.Client con, ServerPreparedStatement preparedStatement)` Decrement use of prepare packet, so closing it if last used
`org.mariadb.jdbc.client.Column[]` `getColumns()` Prepare result-set columns
`org.mariadb.jdbc.client.Column[]` `getParameters()` Prepare parameters
`int` `getStatementId()` Get statement id
`void` `setColumns​(org.mariadb.jdbc.client.Column[] columns)` set prepare result-set columns

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### statementId

    protected int statementId

prepare statement id

### Constructor Detail

#### PrepareResultPacket

    public PrepareResultPacket​(org.mariadb.jdbc.client.ReadableByteBuf buffer,
                               Reader reader,
                               org.mariadb.jdbc.client.Context context)
                        throws IOException

Prepare packet constructor (parsing)

Parameters:
  `buffer` - packet buffer
  `reader` - packet reader
  `context` - connection context
Throws:
  `IOException` - if socket exception occurs

### Method Detail

#### close

    public void close​(org.mariadb.jdbc.client.Client con)
               throws SQLException

Close prepare packet

Specified by:
  `close` in interface `Prepare`
Parameters:
  `con` - current connection
Throws:
  `SQLException` - if exception occurs

#### decrementUse

    public void decrementUse​(org.mariadb.jdbc.client.Client con,
                             ServerPreparedStatement preparedStatement)
                      throws SQLException

Decrement use of prepare packet, so closing it if last used

Specified by:
  `decrementUse` in interface `Prepare`
Parameters:
  `con` - connection
  `preparedStatement` - current prepared statement that was using prepare object
Throws:
  `SQLException` - if exception occurs

#### getStatementId

    public int getStatementId()

Get statement id

Specified by:
  `getStatementId` in interface `Prepare`
Returns:
  statement id

#### getParameters

    public org.mariadb.jdbc.client.Column[] getParameters()

Description copied from interface: `Prepare`
Prepare parameters

Specified by:
  `getParameters` in interface `Prepare`
Returns:
  parameters metadata

#### getColumns

    public org.mariadb.jdbc.client.Column[] getColumns()

Description copied from interface: `Prepare`
Prepare result-set columns

Specified by:
  `getColumns` in interface `Prepare`
Returns:
  result-set columns metadata

#### setColumns

    public void setColumns​(org.mariadb.jdbc.client.Column[] columns)

Description copied from interface: `Prepare`
set prepare result-set columns

Specified by:
  `setColumns` in interface `Prepare`
Parameters:
  `columns` - set result-set columns metadata