Class SQLComplexTable

java.lang.Object
ghidra.features.bsim.query.client.tables.SQLComplexTable
Direct Known Subclasses:
CallgraphTable, DescriptionTable, ExeTable, ExeToCategoryTable, H2VectorTable, IdfLookupTable, KeyValueTable, WeightTable

public abstract class SQLComplexTable extends Object
  • Field Details

    • tableName

      protected final String tableName
    • idColumnName

      protected final String idColumnName
    • db

      protected Connection db
  • Constructor Details

    • SQLComplexTable

      public SQLComplexTable(String tableName, String idColumnName)
  • Method Details

    • setConnection

      public void setConnection(Connection db)
    • close

      public void close()
    • create

      public abstract void create(Statement st) throws SQLException
      Creates the db table.
      Parameters:
      st - the query statement
      Throws:
      SQLException - if there is a problem
    • delete

      public int delete(long id) throws SQLException
      Deletes the row with the given id from the db. Users must set the DELETE_STMT string to delete the exact table they need.
      Parameters:
      id - the database row ID
      Returns:
      the number of deleted rows
      Throws:
      SQLException - if there is a problem creating or executing the query
    • drop

      public void drop(Statement st) throws SQLException
      Drops the current table. NOTE: If explicitly created index tables exist they should be removed first or this method override.
      Parameters:
      st - the query statement
      Throws:
      SQLException - if there is a problem with the execute update command
    • insert

      public abstract long insert(Object... arguments) throws SQLException
      Inserts a row(s) into the db. The arguments passed to this function are by definition not known, so they are left as a variable-length list of Object instances, to be interpreted by the implementer.
      Parameters:
      arguments - any arguments required for the insert
      Returns:
      to be defined by the implementor
      Throws:
      SQLException - if there is a problem executing the insert command