Package ghidra.features.bsim.query.file
Class BSimH2FileDBConnectionManager.BSimH2FileDataSource
java.lang.Object
ghidra.features.bsim.query.file.BSimH2FileDBConnectionManager.BSimH2FileDataSource
- All Implemented Interfaces:
BSimJDBCDataSource
- Enclosing class:
BSimH2FileDBConnectionManager
public static class BSimH2FileDBConnectionManager.BSimH2FileDataSource
extends Object
implements BSimJDBCDataSource
BSimH2FileDBConnectionManager.BSimH2FileDataSource provides a pooled DB data source for a specific H2 File DB.-
Method Summary
Modifier and TypeMethodDescriptionbooleandelete()Delete the database files associated with this H2 File DB.voiddispose()Dispose pooled datasource.booleanbooleanexists()Determine if the stored DB file exists.intGet the number of active connections in the associated connection poolGet a connection to the H2 file database.intGet the number of idle connections in the associated connection poolGet the server info that corresponds to this data source.inthashCode()
-
Method Details
-
getServerInfo
Description copied from interface:BSimJDBCDataSourceGet the server info that corresponds to this data source. It is important to note that the returned instance is normalized for the purpose of caching and may not match the original server info object used to obtain this data source instance.- Specified by:
getServerInfoin interfaceBSimJDBCDataSource- Returns:
- server info
-
dispose
public void dispose()Description copied from interface:BSimJDBCDataSourceDispose pooled datasource.- Specified by:
disposein interfaceBSimJDBCDataSource
-
delete
public boolean delete()Delete the database files associated with this H2 File DB. This will fail immediately if active connections exist. Otherwise removal will be attempted and this data source will no longer be valid.- Returns:
- true if DB sucessfully removed
-
exists
public boolean exists()Determine if the stored DB file exists.- Returns:
- true if the stored DB file exists
-
getStatus
- Specified by:
getStatusin interfaceBSimJDBCDataSource
-
getActiveConnections
public int getActiveConnections()Description copied from interface:BSimJDBCDataSourceGet the number of active connections in the associated connection pool- Specified by:
getActiveConnectionsin interfaceBSimJDBCDataSource- Returns:
- number of active connections
-
getIdleConnections
public int getIdleConnections()Description copied from interface:BSimJDBCDataSourceGet the number of idle connections in the associated connection pool- Specified by:
getIdleConnectionsin interfaceBSimJDBCDataSource- Returns:
- number of idle connections
-
getConnection
Get a connection to the H2 file database. It is important to note that if the database does not exist and empty one will be created. Theexists()method should be used to check for the database existance prior to connecting the first time.- Specified by:
getConnectionin interfaceBSimJDBCDataSource- Returns:
- database connection
- Throws:
SQLException- if a database error occurs
-
getConnectionType
- Specified by:
getConnectionTypein interfaceBSimJDBCDataSource
-
equals
-
hashCode
public int hashCode()
-