# 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

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

## Method Summary

Modifier and Type
Method
Description
`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.
`ColumnDefinition[]`
`getColumns()`
`int`
`getParamCount()`
`ColumnDefinition[]`
`getParameters()`
`ColumnType[]`
`getParameterTypeHeader()`
`int`
`getShareCounter()`
`String`
`getSql()`
`int`
`getStatementId()`
`Protocol`
`getUnProxiedProtocol()`
`boolean`
`incrementShareCounter()`
Increment share counter.
`void`
`resetParameterTypeHeader()`
`void`
`setAddToCache()`
`void`
`setRemoveFromCache()`

### Methods inherited from class Object

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

## Constructor Details

### ServerPrepareResult

public ServerPrepareResult(String sql, int statementId, ColumnDefinition[] columns, ColumnDefinition[] 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 Details

### 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 ColumnDefinition[] getColumns()

### getParameters

public ColumnDefinition[] getParameters()

### getUnProxiedProtocol

public Protocol getUnProxiedProtocol()

### getSql

public String getSql()

Specified by:
  `getSql` in interface `PrepareResult`

### getParameterTypeHeader

public ColumnType[] getParameterTypeHeader()