public interface Handler
Most drivers will use HandlerImpl
, which provides no-op
implementations of all methods. You only need to override methods if you
need to achieve special effects.
Modifier and Type | Interface and Description |
---|---|
static interface |
Handler.ResultSink
Handler for temporary tables.
|
Modifier and Type | Method and Description |
---|---|
void |
onConnectionClose(AvaticaConnection connection)
Called by container when a connection is being closed.
|
void |
onConnectionInit(AvaticaConnection connection)
Called by container when a connection is being created.
|
void |
onStatementClose(AvaticaStatement statement)
Called by container when a statement is being closed.
|
void |
onStatementExecute(AvaticaStatement statement,
Handler.ResultSink resultSink)
Called by container when a statement is being executed.
|
void onConnectionInit(AvaticaConnection connection) throws SQLException
If the implementation of this method throws, the connection will not be created.
connection
- ConnectionSQLException
- on errorvoid onConnectionClose(AvaticaConnection connection)
If the implementation of this method throws, the call to
Connection.close()
that triggered this method will throw an
exception, but the connection will still be marked closed.
connection
- Connectionvoid onStatementExecute(AvaticaStatement statement, Handler.ResultSink resultSink)
If the session would like the statement results stored in a temporary
table, resultSink
is not null.
The provider must call its Handler.ResultSink.toBeCompleted()
method at some point during execution (not necessarily before the call to
this method returns).
statement
- StatementresultSink
- Place to put result of query. Null if container does not
want results stored to a temporary tableRuntimeException
- on errorvoid onStatementClose(AvaticaStatement statement)
This method is called after marking the statement closed, and after
closing any open ResultSet
objects.
If the implementation of this method throws, the call to
Statement.close()
that triggered this method will throw an
exception, but the statement will still be marked closed.
statement
- StatementRuntimeException
- on errorCopyright © 2012-2024 Apache Software Foundation. All Rights Reserved.