Class StatementListenerDispatcher
- All Implemented Interfaces:
Iterable<StatementListener>,StatementListener
StatementListener.- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterLast(FbStatement sender) Method to be notified when the cursor of a statement is positioned after the last row.voidbeforeFirst(FbStatement sender) Method to be notified when the cursor of a statement is positioned before the first row.voidfetchComplete(FbStatement sender, FetchDirection fetchDirection, int rows) Method to be notified of the number of rows fetched in a singleFbStatement.fetchRows(int).protected voidvoidreceivedRow(FbStatement sender, RowValue rowValue) Method to be notified of a new row of data.voidsqlCounts(FbStatement sender, SqlCountHolder sqlCounts) Called when the SQL counts of a statement have been retrieved.voidstatementExecuted(FbStatement sender, boolean hasResultSet, boolean hasSingletonResult) Method to be notified when a statement has been executed.voidstatementStateChanged(FbStatement sender, StatementState newState, StatementState previousState) Method to be notified when the state of a statement has changed.voidwarningReceived(FbStatement sender, SQLWarning warning) Called when a warning was received for thesenderstatement.Methods inherited from class org.firebirdsql.gds.ng.listeners.AbstractListenerDispatcher
addListener, addWeakListener, isShutdown, iterator, notify, removeAllListeners, removeListener, shutdownMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
StatementListenerDispatcher
public StatementListenerDispatcher()
-
-
Method Details
-
receivedRow
Description copied from interface:StatementListenerMethod to be notified of a new row of data.Listeners that process
StatementListener.beforeFirst(FbStatement)and/orStatementListener.afterLast(FbStatement)should consider calls to this method to clear the before-first or after-last state to an- in-cursor
state.- Specified by:
receivedRowin interfaceStatementListener- Parameters:
sender- theFbStatementthat called this methodrowValue- The row values.
-
fetchComplete
Description copied from interface:StatementListenerMethod to be notified of the number of rows fetched in a singleFbStatement.fetchRows(int).This method will not be called for singleton results of statements like
EXECUTE PROCEDURE.When end of cursor is reached, it is undefined whether this method will be called first or
afterLast/beforeFirst. Listeners must be prepared to handle either order.- Specified by:
fetchCompletein interfaceStatementListener- Parameters:
sender- theFbStatementthat called this methodfetchDirection- fetch direction of the completed fetch operationrows- number of rows fetched in the completed fetch operation (NOTE: for native implementations, this will always be1or0for end of cursor)
-
beforeFirst
Description copied from interface:StatementListenerMethod to be notified when the cursor of a statement is positioned before the first row.When server-side scrolling is used, this method can be called multiple times during the lifetime of a single open cursor. This method may be called even if the cursor is already before-first.
- Specified by:
beforeFirstin interfaceStatementListener- Parameters:
sender- theFbStatementthat called this method- See Also:
-
afterLast
Description copied from interface:StatementListenerMethod to be notified when the cursor of a statement is positioned after the last row.When server-side scrolling is used, this method might be called multiple times during the lifetime of a single open cursor. This method may be called even if the cursor is already after-last.
- Specified by:
afterLastin interfaceStatementListener- Parameters:
sender- theFbStatementthat called this method- See Also:
-
statementExecuted
Description copied from interface:StatementListenerMethod to be notified when a statement has been executed.This event with
hasResultSet=truecan be seen as a counterpart ofStatementListener.afterLast(FbStatement).- Specified by:
statementExecutedin interfaceStatementListener- Parameters:
sender- theFbStatementthat called this methodhasResultSet-truethere is a result set,falsethere is no result sethasSingletonResult-truesingleton result,falsestatement will produce indeterminate number of rows; can be ignored whenhasResultSetisfalse
-
statementStateChanged
public void statementStateChanged(FbStatement sender, StatementState newState, StatementState previousState) Description copied from interface:StatementListenerMethod to be notified when the state of a statement has changed.- Specified by:
statementStateChangedin interfaceStatementListener- Parameters:
sender- theFbStatementthat called this methodnewState- new state of the statementpreviousState- old state of the statement
-
warningReceived
Description copied from interface:StatementListenerCalled when a warning was received for thesenderstatement.- Specified by:
warningReceivedin interfaceStatementListener- Parameters:
sender- Statement receiving the warningwarning- Warning
-
sqlCounts
Description copied from interface:StatementListenerCalled when the SQL counts of a statement have been retrieved.- Specified by:
sqlCountsin interfaceStatementListener- Parameters:
sender- Statement that called this methodsqlCounts- SQL counts
-
logError
- Specified by:
logErrorin classAbstractListenerDispatcher<StatementListener>
-