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 Details

    • getServerInfo

      public BSimServerInfo 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 interface BSimJDBCDataSource
      Returns:
      server info
    • dispose

      public void dispose()
      Description copied from interface: BSimJDBCDataSource
      Dispose pooled datasource.
      Specified by:
      dispose in interface BSimJDBCDataSource
    • 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

      public FunctionDatabase.Status getStatus()
      Specified by:
      getStatus in interface BSimJDBCDataSource
    • getActiveConnections

      public int getActiveConnections()
      Description copied from interface: BSimJDBCDataSource
      Get the number of active connections in the associated connection pool
      Specified by:
      getActiveConnections in interface BSimJDBCDataSource
      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 interface BSimJDBCDataSource
      Returns:
      number of idle connections
    • getConnection

      public Connection getConnection() throws SQLException
      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. The exists() method should be used to check for the database existance prior to connecting the first time.
      Specified by:
      getConnection in interface BSimJDBCDataSource
      Returns:
      database connection
      Throws:
      SQLException - if a database error occurs
    • getConnectionType

      public FunctionDatabase.ConnectionType getConnectionType()
      Specified by:
      getConnectionType in interface BSimJDBCDataSource
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object