org.mariadb.jdbc.internal.util.dao

## Class PrepareResult

- java.lang.Object
- - org.mariadb.jdbc.internal.util.dao.PrepareResult

    public class PrepareResult
    extends Object

### Constructor Summary

Constructors
Constructor and Description
`PrepareResult(int statementId, ColumnInformation[] columns, ColumnInformation[] parameters, Protocol unProxiedProtocol)` PrepareStatement Result object.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `canBeDeallocate()` Asked if can be deallocate (is not shared in other statement and not in cache) Set deallocate flag to true if so.
`void` `decrementShareCounter()`
`void` `failover(int statementId, Protocol unProxiedProtocol)` Update information after a failover.
`ColumnInformation[]` `getColumns()`
`ColumnInformation[]` `getParameters()`
`int` `getShareCounter()`
`int` `getStatementId()`
`Protocol` `getUnProxiedProtocol()`
`boolean` `incrementShareCounter()` Increment share counter.
`boolean` `isExecuteOnMaster()`
`boolean` `mustRePrepareOnSlave()` If PrepareStatement was executed initially on slave connection, but after a failover, was using temporary the master connection, indicate if has to be reprepare on Slave connection when reconnected.
`void` `setAddToCache()`
`void` `setRemoveFromCache()`

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

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

### Constructor Detail

#### PrepareResult

    public PrepareResult(int statementId,
                         ColumnInformation[] columns,
                         ColumnInformation[] parameters,
                         Protocol unProxiedProtocol)

PrepareStatement Result object.

Parameters:
  `statementId` - server statement Id.
  `columns` - columns information
  `parameters` - parameters information
  `unProxiedProtocol` - indicate the protocol on which the prepare has been done

### Method Detail

#### failover

    public void failover(int statementId,
                         Protocol unProxiedProtocol)

Update information after a failover.

Parameters:
  `statementId` - new statement Id
  `unProxiedProtocol` - the protocol on which the prepare has been done

#### setAddToCache

    public void setAddToCache()

#### setRemoveFromCache

    public void setRemoveFromCache()

#### incrementShareCounter

    public boolean incrementShareCounter()

Increment share counter.

Returns:
  true if can be used (is not been deallocate).

#### decrementShareCounter

    public void decrementShareCounter()

#### canBeDeallocate

    public boolean canBeDeallocate()

Asked if can be deallocate (is not shared in other statement and not in cache) Set deallocate flag to true if so.

Returns:
  true if can be deallocate

#### getShareCounter

    public int getShareCounter()

#### getStatementId

    public int getStatementId()

#### getColumns

    public ColumnInformation[] getColumns()

#### getParameters

    public ColumnInformation[] getParameters()

#### getUnProxiedProtocol

    public Protocol getUnProxiedProtocol()

#### mustRePrepareOnSlave

    public boolean mustRePrepareOnSlave()

If PrepareStatement was executed initially on slave connection, but after a failover, was using temporary the master connection, indicate if has to be reprepare on Slave connection when reconnected.

Returns:
  true if has to be reprepared on Slave connection

#### isExecuteOnMaster

    public boolean isExecuteOnMaster()