@Volatile(reason="Experimental") public final class FBTableStatisticsManager extends java.lang.Object implements java.lang.AutoCloseable
Connection.
The table statistics are execution statistics of the specific connection, and are not global statistics.
This manager retains a reference to underlying FbDatabase instance and holds a cache
of table names. Closing this manager will remove the reference the database handle (but not close it!) and releases
the cache.
This class is not thread-safe (though its use of the underlying connection is thread-safe).
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Clears the reference to the connection and clears the cache.
|
java.util.Map<java.lang.String,TableStatistics> |
getTableStatistics()
Obtains a snapshot of the table statistics of this connection.
|
static FBTableStatisticsManager |
of(java.sql.Connection connection)
Creates a table statistics manager for the current connection.
|
public static FBTableStatisticsManager of(java.sql.Connection connection) throws java.sql.SQLException
connection - Connection to gather statistics on.java.sql.SQLException - if connection is closedpublic java.util.Map<java.lang.String,TableStatistics> getTableStatistics() throws java.sql.SQLException
A table is only present in the map if this connection touched it in a way which generated a statistic.
InfoTruncatedException - if a truncated response is received, after retrying 3 times (total: 4 attempts) while increasing
the buffer size; it is possible that subsequent calls to this method may recover (as that will increase
the buffer size even more)java.sql.SQLException - if the connection is closed, or if obtaining the statistics failed due to a database access errorpublic void close()
This method does not close the connection wrapped by this manager.
Closing a table statistics manager is not required. It can be used to clean up early, or to prevent a user of this class from gathering further statistics.
close in interface java.lang.AutoCloseableCopyright © 2001-2023 Jaybird (Firebird JDBC) team. All rights reserved.