org.firebirdsql.gds.ng

## Enum StatementState

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

All Implemented Interfaces:
  java.io.Serializable, java.lang.Comparable<StatementState>

    public enum StatementState
    extends java.lang.Enum<StatementState>

Statement states for `FbStatement` implementations

Since:
  3.0
Author:
  Mark Rotteveel

### Enum Constant Summary

Enum Constants
Enum Constant and Description
`ALLOCATED` Statement has been allocated
`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

### Method Summary

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

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

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

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

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

### Enum Constant Detail

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

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

#### values

    public static StatementState[] values()

Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

    for (StatementState c : StatementState.values())
        System.out.println(c);

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

#### valueOf

    public static StatementState valueOf(java.lang.String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
  `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
  `java.lang.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 java.util.Set<StatementState> validTransitionSet()

Returns:
  Set of valid transitions from this state