- All Implemented Interfaces:
AutoCloseable
,Statement
,Wrapper
,FirebirdStatement
- Direct Known Subclasses:
FBStatement
This class is internal API of Jaybird. Future versions may radically change, move, or make inaccessible this type.
For the public API, refer to the Statement
and FirebirdStatement
interfaces.
- Since:
- 6
- Author:
- Mark Rotteveel
-
Field Summary
FieldsFields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractStatement
(FBConnection connection, ResultSetBehavior resultSetBehavior) -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
addWarning
(SQLWarning warning) protected final void
Check if this statement is valid (not closed).final void
void
close()
final void
final void
Completes this statement withCompletionReason.OTHER
.abstract void
completeStatement
(CompletionReason reason) Completes this statement withreason
.final boolean
protected final FetchConfig
final FBConnection
protected final @Nullable String
final int
final int
final long
final int
The local statement id is intended to identify the statement for internal implementation purposes.final int
final int
final int
final int
protected abstract FbStatement
abstract int
Get the current statement type of this statement.final @Nullable SQLWarning
final int
hashCode()
final boolean
isClosed()
final boolean
final boolean
boolean
isValid()
Check if this statement is valid.protected final void
Closes this statement ifcloseOnCompletion
is set totrue
, does nothing if set tofalse
.protected final ResultSetBehavior
final void
setCursorName
(@Nullable String cursorName) final void
setFetchDirection
(int direction) final void
setFetchSize
(int rows) final void
setLargeMaxRows
(long max) final void
setMaxRows
(int max) final void
setPoolable
(boolean poolable) protected final LockCloseable
withLock()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.firebirdsql.jdbc.FirebirdStatement
getCurrentResultSet, getDeletedRowsCount, getExecutionPlan, getExplainedExecutionPlan, getInsertedRowsCount, getLastExecutionPlan, getLastExplainedExecutionPlan, getUpdatedRowsCount, hasOpenResultSet
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getGeneratedKeys, getLargeUpdateCount, getMaxFieldSize, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getUpdateCount, isSimpleIdentifier, setEscapeProcessing, setMaxFieldSize, setQueryTimeout
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Field Details
-
connection
-
-
Constructor Details
-
AbstractStatement
-
-
Method Details
-
getConnection
- Specified by:
getConnection
in interfaceStatement
- Throws:
SQLException
-
getStatementHandle
- Returns:
- instance of
FbStatement
associated with this statement; cannot benull
- Throws:
SQLException
- if this statement is closedSQLFeatureNotSupportedException
- if this statement implementation does not use statement handles
-
getStatementType
public abstract int getStatementType()Get the current statement type of this statement.The returned value is one of the
TYPE_*
constant values defined inFirebirdPreparedStatement
, or0
if the statement currently does not have a statement type.- Returns:
- The identifier for the given statement's type
-
close
Subclasses overriding this method are expected to call this method with
super.close()
at an appropriate point to mark it closed.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceStatement
- Throws:
SQLException
-
isClosed
public final boolean isClosed() -
isValid
public boolean isValid()Description copied from interface:FirebirdStatement
Check if this statement is valid.- Specified by:
isValid
in interfaceFirebirdStatement
- Returns:
true
if statement is valid and can be used to execute SQL.
-
checkValidity
Check if this statement is valid (not closed). This method should be invoked before executing any action which requires a valid/open statement.- Throws:
SQLException
- if this Statement has been closed and cannot be used anymore.
-
completeStatement
Completes this statement withCompletionReason.OTHER
.- Throws:
SQLException
- for failures completing this statement- See Also:
-
completeStatement
Completes this statement withreason
.On completion, any open result set will be closed, and possibly the statement itself may be closed.
- Parameters:
reason
- completion reason- Throws:
SQLException
- for failures completing this statement
-
isPoolable
- Specified by:
isPoolable
in interfaceStatement
- Throws:
SQLException
-
setPoolable
- Specified by:
setPoolable
in interfaceStatement
- Throws:
SQLException
-
isCloseOnCompletion
- Specified by:
isCloseOnCompletion
in interfaceStatement
- Throws:
SQLException
-
closeOnCompletion
- Specified by:
closeOnCompletion
in interfaceStatement
- Throws:
SQLException
-
performCloseOnCompletion
Closes this statement ifcloseOnCompletion
is set totrue
, does nothing if set tofalse
.- Throws:
SQLException
- for errors closing this statement- See Also:
-
fetchConfig
- Returns:
- current fetch config for this statement
- Since:
- 6
-
resultSetBehavior
- Returns:
- result set behavior for this statement
- Since:
- 6
-
getResultSetType
- Specified by:
getResultSetType
in interfaceStatement
- Throws:
SQLException
-
getResultSetConcurrency
- Specified by:
getResultSetConcurrency
in interfaceStatement
- Throws:
SQLException
-
getResultSetHoldability
- Specified by:
getResultSetHoldability
in interfaceStatement
- Throws:
SQLException
-
getMaxRows
- Specified by:
getMaxRows
in interfaceStatement
- Throws:
SQLException
-
setMaxRows
- Specified by:
setMaxRows
in interfaceStatement
- Throws:
SQLException
-
setLargeMaxRows
Jaybird does not support maxRows exceeding
Integer.MAX_VALUE
, if a larger value is set, Jaybird will add a warning to the statement and reset the maximum to 0.- Specified by:
setLargeMaxRows
in interfaceStatement
- Throws:
SQLException
-
getLargeMaxRows
Jaybird does not support maxRows exceeding
Integer.MAX_VALUE
, the return value of this method is the same asgetMaxRows()
.- Specified by:
getLargeMaxRows
in interfaceStatement
- Throws:
SQLException
-
getFetchSize
- Specified by:
getFetchSize
in interfaceStatement
- Throws:
SQLException
-
setFetchSize
- Specified by:
setFetchSize
in interfaceStatement
- Throws:
SQLException
-
getFetchDirection
- Specified by:
getFetchDirection
in interfaceStatement
- Throws:
SQLException
-
setFetchDirection
- Specified by:
setFetchDirection
in interfaceStatement
- Throws:
SQLException
-
setCursorName
- Specified by:
setCursorName
in interfaceStatement
- Throws:
SQLException
-
getCursorName
- Returns:
- current value of
cursorName
- See Also:
-
getWarnings
If connection property
reportSQLWarnings
is set toNONE
(case-insensitive), this method will not report warnings and always returnnull
.- Specified by:
getWarnings
in interfaceStatement
- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarnings
in interfaceStatement
- Throws:
SQLException
-
addWarning
-
getLocalStatementId
public final int getLocalStatementId()Description copied from interface:FirebirdStatement
The local statement id is intended to identify the statement for internal implementation purposes.NOTE: This method is only included in this interface to try and avoid problems with proxied and bytecode enhanced classes in certain libraries, you should normally have no reason to call this method directly.
The id is expected - but not guaranteed - to be unique for a single connection, and - preferably - for the entire JVM run time as well.
- Specified by:
getLocalStatementId
in interfaceFirebirdStatement
- Returns:
- The local statement id.
-
hashCode
public final int hashCode() -
equals
-
withLock
- See Also:
-