public class TableResourceManager extends Object
{@link TableResourceManager }
is a container for a {@link Connection}
, a {@link Statement}
and a {@link Set}
of {@link ResultSet}
associated with the {@link Connection}
.Constructor and Description |
---|
TableResourceManager(Connection conn,
Statement stmt) |
Modifier and Type | Method and Description |
---|---|
void |
addAllResultSets(List<ResultSet> resultSets)
Add a list of
{@link ResultSet} to the Set of result sets. |
void |
addResultSet(ResultSet rs)
Add a
{@link ResultSet} to the Set of result sets. |
void |
gracefullyReleaseResources(boolean isInTransaction)
Close the statement only if all ResultSets are closed, and close the connection only if all ResultSets are
closed and a transaction is not in progress.
|
void |
releaseResources()
Close the connection and the statement.
|
public TableResourceManager(Connection conn, Statement stmt)
public void releaseResources() throws SQLException
SQLException
- if an issue occur while closing the connection or statementpublic void addResultSet(ResultSet rs)
{@link ResultSet}
to the Set of result sets. This {@link ResultSet}
should be a one
associated with the connection. If an unrelated {@link ResultSet}
is added it may result in undesirable
consequences as when calling gracefullyReleaseResources(boolean)
releasing resources is based on
whether all the result sets are closed.rs
- the result set to be addedpublic void addAllResultSets(List<ResultSet> resultSets)
{@link ResultSet}
to the Set of result sets. If an unrelated {@link ResultSet}
is added it may result in undesirable consequences as when calling gracefullyReleaseResources(boolean)
releasing resources is based on whether all the result sets are closed.resultSets
- the list of result sets to be addedpublic void gracefullyReleaseResources(boolean isInTransaction) throws SQLException
isInTransaction
- Whether a transaction is in progressSQLException
- if an issue occur while closing the connection or statementCopyright © 2018 WSO2. All rights reserved.