Class Querier

java.lang.Object
org.conical.common.bbl.db.querier.Querier
Direct Known Subclasses:
MySqlQuerier, OracleQuerier, PostgresQuerier

public abstract class Querier extends Object
Abstract class which provides an interface allowing callers to look up table and column names in a database. Children should implement the parts of this class that are vendor-specific.
Author:
rdoherty
  • Constructor Details

  • Method Details

    • getTableSelectionSql

      protected abstract String getTableSelectionSql()
    • getPsForColumnLookup

      protected abstract PreparedStatement getPsForColumnLookup(Connection conn, String tableName) throws SQLException
      Throws:
      SQLException
    • getColumnModelFromResult

      protected abstract ColumnModel getColumnModelFromResult(ResultSet rs) throws SQLException
      Throws:
      SQLException
    • assignKeyInformation

      protected void assignKeyInformation(Set<ColumnModel> columnSet, String tableName)
    • getConnection

      protected Connection getConnection() throws SQLException
      Throws:
      SQLException
    • getTableNames

      public Set<String> getTableNames()
      Retrieves a set of all readable table names in the database this Querier was configured for
      Returns:
      a set of table names
    • getColumnsFromTable

      public Set<ColumnModel> getColumnsFromTable(String tableName)
      Retrieves a set of all the columns in the table with the given name
      Parameters:
      tableName - name for which to retrieve columns
      Returns:
      set of columns