Interface IDriverWrapper

All Known Implementing Classes:
MysqlDriverWrapper, PostgresDriverWrapper, RedshiftDriverWrapper, SqlServerDriverWrapper

public interface IDriverWrapper
A class for abstracting away the different terminology and parameters for obtaining JDBC data; for use in the GUI JDBC importing framework to make it friendlier for our users.
  • Field Details

  • Method Details

    • friendlyName

      String friendlyName()
      For example "Mysql", "Oracle", "MS SQL Server"; shows up in the Combo Box dropdown of the different Drivers.
      Returns:
      a friendly name for this driver wrapper
    • driverClass

      String driverClass()
      The class used by JDBC for this driver.
      Returns:
      the name of the class to load for this driver
    • isValidUrl

      boolean isValidUrl​(String uri)
      Check if this is a valid URL for this driver.
    • getCatalogNames

      String[] getCatalogNames​(Connection connection) throws SQLException
      Get the list of Catalogs. For our purposes, a catalog is simply a bucket of table names. Catalog matches the JDBC connection meta-data terminology; but does not map to all DBMSes.
      Parameters:
      connection - the JDBC connection
      Returns:
      an array of catalog names
      Throws:
      SQLException - when the underlying SQL operation fails
    • catalogName

      String catalogName()
      What should the UI use to describe a catalog?
    • defaultUrl

      String defaultUrl()
      What should the default URL for this driver be?
    • getTableNames

      String[] getTableNames​(Connection connection, String catalogName) throws SQLException
      Get the list of tables within a catalog.
      Parameters:
      connection - the JDBC connection
      catalogName - the catalog to get names for
      Returns:
      an array of table names
      Throws:
      SQLException - when the underlying SQL operation fails
    • hasScrollableCursors

      boolean hasScrollableCursors()
      Return if the driver supports scrollable cursors
      Returns:
    • getServerTimeZone

      TimeZone getServerTimeZone​(Connection conn) throws SQLException
      Return server time zone (for interpreting datetime values)
      Throws:
      SQLException
    • quoteEscapeTableName

      String quoteEscapeTableName​(String schemaName, String tableName)
      Quote and escape a table name in accordance with the particular DBMS, for use in a query. Should handle unusual characters in table names (e.g. whitespace), if permitted by the DBAM, and prevent SQL injection attacks.
      Parameters:
      schemaName - the raw unquoted, unescaped schema name
      tableName - the raw unquoted, unescaped table name
      Returns:
      the quoted, escaped table name
    • quoteEscapeColumnName

      String quoteEscapeColumnName​(String columnName)
      Quote and escape a column name in accordance with the particular DBMS, for use in a query. Should handle unusual characters in table names (e.g. whitespace), if permitted by the DBAM, and prevent SQL injection attacks.
      Parameters:
      columnName - the raw unquoted, unescaped column name
      Returns:
      the quoted, escaped table name
    • displayInfo

      default IDriverWrapper.DisplayInfo displayInfo()
      Creates a DisplayInfo object for this driver wrapper.
      Returns:
      display info for this driver wrapper.
    • load

      default void load() throws Exception
      Throws:
      Exception