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 TypeMethodDescriptionboolean
delete()
Delete the database files associated with this H2 File DB.void
dispose()
Dispose pooled datasource.boolean
boolean
exists()
Determine if the stored DB file exists.int
Get the number of active connections in the associated connection poolGet a connection to the H2 file database.int
Get the number of idle connections in the associated connection poolGet the server info that corresponds to this data source.int
hashCode()
-
Method Details
-
getServerInfo
Description copied from interface:BSimJDBCDataSource
Get 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:
getServerInfo
in interfaceBSimJDBCDataSource
- Returns:
- server info
-
dispose
public void dispose()Description copied from interface:BSimJDBCDataSource
Dispose pooled datasource.- Specified by:
dispose
in 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:
getStatus
in interfaceBSimJDBCDataSource
-
getActiveConnections
public int getActiveConnections()Description copied from interface:BSimJDBCDataSource
Get the number of active connections in the associated connection pool- Specified by:
getActiveConnections
in interfaceBSimJDBCDataSource
- Returns:
- number of active connections
-
getIdleConnections
public int getIdleConnections()Description copied from interface:BSimJDBCDataSource
Get the number of idle connections in the associated connection pool- Specified by:
getIdleConnections
in 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:
getConnection
in interfaceBSimJDBCDataSource
- Returns:
- database connection
- Throws:
SQLException
- if a database error occurs
-
getConnectionType
- Specified by:
getConnectionType
in interfaceBSimJDBCDataSource
-
equals
-
hashCode
public int hashCode()
-