## org.mariadb.jdbc.internal.util.dao
Class ServerPrepareResult

    java.lang.Object
      org.mariadb.jdbc.internal.util.dao.ServerPrepareResult

All Implemented Interfaces:
  PrepareResult

    public class ServerPrepareResult

extends Object
implements PrepareResult

Constructor Summary
`ServerPrepareResult(String sql, int statementId, ColumnInformation[] columns, ColumnInformation[] parameters, Protocol unProxiedProtocol)` PrepareStatement Result object.

Method Summary
`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.
`void` `fetchAllOpenCursor()` if a new query will be done using this statementId and there is an open cursor, then fetch all results in resultSet (Cursor will be closed after executing a query).
`ColumnInformation[]` `getColumns()`
`int` `getParamCount()`
`ColumnInformation[]` `getParameters()`
`ColumnType[]` `getParameterTypeHeader()`
`int` `getShareCounter()`
`String` `getSql()`
`int` `getStatementId()`
`Protocol` `getUnProxiedProtocol()`
`boolean` `incrementShareCounter()` Increment share counter.
`void` `openCursor(Results result)`
`void` `resetParameterTypeHeader()`
`void` `setAddToCache()`
`void` `setRemoveFromCache()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ServerPrepareResult

    public ServerPrepareResult(String sql,
                               int statementId,
                               ColumnInformation[] columns,
                               ColumnInformation[] parameters,
                               Protocol unProxiedProtocol)

  PrepareStatement Result object.

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

Method Detail

### resetParameterTypeHeader

    public void resetParameterTypeHeader()

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

### getParamCount

    public int getParamCount()

  Specified by:
    `getParamCount` in interface `PrepareResult`

### getShareCounter

    public int getShareCounter()

### getStatementId

    public int getStatementId()

### getColumns

    public ColumnInformation[] getColumns()

### getParameters

    public ColumnInformation[] getParameters()

### getUnProxiedProtocol

    public Protocol getUnProxiedProtocol()

### getSql

    public String getSql()

  Specified by:
    `getSql` in interface `PrepareResult`

### getParameterTypeHeader

    public ColumnType[] getParameterTypeHeader()

### openCursor

    public void openCursor(Results result)

### fetchAllOpenCursor

    public void fetchAllOpenCursor()

  if a new query will be done using this statementId and there is an open cursor, then fetch all results in resultSet (Cursor will be closed after executing a query).

Copyright © 2017. All rights reserved.