Package 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 forFbStatementimplementations- Since:
- 3.0
- Author:
- Mark Rotteveel
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALLOCATEDStatement has been allocatedCLOSEDStatement is closed or has been de-allocatedCLOSINGA statement is being closed, this is an ephemeral state that should only last as long as releasing resources on the database takes.CURSOR_OPENStatement has been executed, cursor is still openERRORLast statement execute or prepare resulted in an errorEXECUTINGA statement is being executed, this is an ephemeral state that should only last as long as the execute call to the database takes.NEWStatement is new and no statement handle has been allocated on the server.PREPAREDStatement has been prepared
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisCursorOpen()Can a cursor be open in the current state?booleanisValidTransition(StatementState toState)Is the transition totoStatevalid from this state.java.util.Set<StatementState>validTransitionSet()static StatementStatevalueOf(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.
-
-
-
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 namejava.lang.NullPointerException- if the argument is null
-
isCursorOpen
public boolean isCursorOpen()
Can a cursor be open in the current state?- Returns:
truea cursor can be open in this state
-
isValidTransition
public final boolean isValidTransition(StatementState toState)
Is the transition totoStatevalid from this state.- Parameters:
toState- The next state- Returns:
truetransition is valid
-
validTransitionSet
public final java.util.Set<StatementState> validTransitionSet()
- Returns:
- Set of valid transitions from this state
-
-