public interface DatabaseFutureResult
DatabaseTransaction.commit(long)
or DatabaseTransaction.rollback(long)
on the DatabaseTransaction
used when the query request was submitted.
Whether the query used a transaction or not, the close()
method MUST be called after
the SBB is finished with the ResultSet. The resource adaptor has no other way of knowing when to close the resources.
See the DatabaseQueryProvider
documentation for details on how to
send a synchronous query and use of this interface.
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the result set and prepared statement.
|
String |
getDataSourceNameUsed()
Which of the configured DataSource names was used for the query.
|
boolean |
getResult(long timeout)
Retrieve the result of the execute when it is available.
|
ResultSet |
getResultSet(long timeout)
Retrieve the result of the query when it is available.
|
Statement |
getStatement(long timeout)
Retrieve the Statement that was used to query the Database.
|
int |
getUpdateResult(long timeout)
Retrieve the result of the update when it is available.
|
String getDataSourceNameUsed()
ResultSet getResultSet(long timeout) throws SQLException, TimeoutException, InsufficientResourcesException, IllegalStateException, DatabaseQueryException
timeout
- timeout in milliseconds, 0 to use QueryTimeout from the DataSource profileIllegalArgumentException
- if value of timeout negative or execute type not QueryInfo.ExecuteType.QUERY
SQLException
- if an SQL exception occurred executing the query or retrieving the result setTimeoutException
- if the specified timeout elapsesInsufficientResourcesException
- if the request could not be sent due to lack of worker threads or connectionsIllegalStateException
- if the request could not be sent due to RA entity stoppingDatabaseQueryException
- if any other problem occurs (including expiration of QueryTimeout from DataSource profile)Statement getStatement(long timeout) throws SQLException, TimeoutException, InsufficientResourcesException, IllegalStateException, DatabaseQueryException
timeout
- timeout in milliseconds, 0 to use QueryTimeout from the DataSource profileIllegalArgumentException
- if value of timeout negativeSQLException
- if an SQL exception occurred executing the queryTimeoutException
- if the specified timeout elapsesInsufficientResourcesException
- if the request could not be sent due to lack of worker threads or connectionsIllegalStateException
- if the request could not be sent due to RA entity stoppingDatabaseQueryException
- if any other problem occurs (including expiration of QueryTimeout from DataSource profile)int getUpdateResult(long timeout) throws SQLException, TimeoutException, InsufficientResourcesException, IllegalStateException, DatabaseQueryException
timeout
- timeout in milliseconds, 0 to use QueryTimeout from the DataSource profileIllegalArgumentException
- if value of timeout negative or execute type not QueryInfo.ExecuteType.UPDATE
SQLException
- if an SQL exception occurred executing the query or retrieving the result setTimeoutException
- if the specified timeout elapsesInsufficientResourcesException
- if the request could not be sent due to lack of worker threads or connectionsIllegalStateException
- if the request could not be sent due to RA entity stoppingDatabaseQueryException
- if any other problem occurs (including expiration of QueryTimeout from DataSource profile)boolean getResult(long timeout) throws SQLException, TimeoutException, InsufficientResourcesException, IllegalStateException, DatabaseQueryException
timeout
- timeout in milliseconds, 0 to use QueryTimeout from the DataSource profileIllegalArgumentException
- if value of timeout negative or execute type not QueryInfo.ExecuteType.EXECUTE
SQLException
- if an SQL exception occurred executing the query or retrieving the result setTimeoutException
- if the specified timeout elapsesInsufficientResourcesException
- if the request could not be sent due to lack of worker threads or connectionsIllegalStateException
- if the request could not be sent due to RA entity stoppingDatabaseQueryException
- if any other problem occurs (including expiration of QueryTimeout from DataSource profile)void close()
DatabaseTransaction.commit(long)
or
DatabaseTransaction.rollback(long)
must also be called at some later time.