Module org.firebirdsql.jaybird
Package org.firebirdsql.gds.ng

# Enum Class StatementState

java.lang.Object
java.lang.Enum<StatementState>
org.firebirdsql.gds.ng.StatementState

All Implemented Interfaces:
  `Serializable`, `Comparable<StatementState>`, `Constable`

public enum StatementState extends Enum<StatementState>
Statement states for `FbStatement` implementations

Since:
  3.0
Author:
  Mark Rotteveel

## Nested Class Summary

## Nested classes/interfaces inherited from class java.lang.Enum

`Enum.EnumDesc<E extends Enum<E>>`

## Enum Constant Summary

Enum Constants
Enum Constant
Description
`ALLOCATED`
Statement has been allocated or unprepared.
`CLOSED`
Statement is closed or has been de-allocated.
`CLOSING`
A statement is being closed, this is an ephemeral state that should only last as long as releasing resources on the database takes.
`CURSOR_OPEN`
Statement has been executed, cursor is still open.
`ERROR`
Last statement execute or prepare resulted in an error.
`EXECUTING`
A statement is being executed, this is an ephemeral state that should only last as long as the execute call to the database takes.
`NEW`
Statement is new and no statement handle has been allocated on the server.
`PREPARED`
Statement has been prepared.
`PREPARING`
Statement is preparing a new statement text, this is an ephemeral state that should only last as long as the prepare call to the database takes.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`isCursorOpen()`
Can a cursor be open in the current state?
`final boolean`
`isValidTransition(StatementState toState)`
Is the transition to `toState` valid from this state.
`final Set<StatementState>`
`validTransitionSet()`
`static StatementState`
`valueOf(String name)`
Returns the enum constant of this class with the specified name.
`static StatementState[]`
`values()`
Returns an array containing the constants of this enum class, in the order they are declared.

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

`clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

`getClass, notify, notifyAll, wait, wait, wait`

## Enum Constant Details

### NEW

public static final StatementState NEW
Statement is new and no statement handle has been allocated on the server.

### CLOSING

public static final StatementState CLOSING
A statement is being closed, this is an ephemeral state that should only last as long as releasing resources on the database takes.

### CLOSED

public static final StatementState CLOSED
Statement is closed or has been de-allocated.

### ALLOCATED

public static final StatementState ALLOCATED
Statement has been allocated or unprepared.

### PREPARING

public static final StatementState PREPARING
Statement is preparing a new statement text, this is an ephemeral state that should only last as long as the prepare call to the database takes.

### PREPARED

public static final StatementState PREPARED
Statement has been prepared.

### EXECUTING

public static final StatementState EXECUTING
A statement is being executed, this is an ephemeral state that should only last as long as the execute call to the database takes.

### CURSOR_OPEN

public static final StatementState CURSOR_OPEN
Statement has been executed, cursor is still open.

### ERROR

public static final StatementState ERROR
Last statement execute or prepare resulted in an error.

## Method Details

### values

public static StatementState[] values()
Returns an array containing the constants of this enum class, in the order they are declared.

Returns:
  an array containing the constants of this enum class, in the order they are declared

### valueOf

public static StatementState valueOf(String name)
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)

Parameters:
  `name` - the name of the enum constant to be returned.
Returns:
  the enum constant with the specified name
Throws:
  `IllegalArgumentException` - if this enum class has no constant with the specified name
  `NullPointerException` - if the argument is null

### isCursorOpen

public boolean isCursorOpen()
Can a cursor be open in the current state?

Returns:
  `true` a cursor can be open in this state

### isValidTransition

public final boolean isValidTransition(StatementState toState)
Is the transition to `toState` valid from this state.

Parameters:
  `toState` - The next state
Returns:
  `true` transition is valid

### validTransitionSet

public final Set<StatementState> validTransitionSet()

Returns:
  Set of valid transitions from this state