Class PostgresDriverWrapper

java.lang.Object
com.illumon.iris.pqimport.gui.jdbc.PostgresDriverWrapper
All Implemented Interfaces:
IDriverWrapper

public class PostgresDriverWrapper extends Object implements IDriverWrapper
  • Constructor Details

    • PostgresDriverWrapper

      public PostgresDriverWrapper(com.fishlib.io.logger.Logger log)
  • Method Details

    • friendlyName

      public String friendlyName()
      Description copied from interface: IDriverWrapper
      For example "Mysql", "Oracle", "MS SQL Server"; shows up in the Combo Box dropdown of the different Drivers.
      Specified by:
      friendlyName in interface IDriverWrapper
      Returns:
      a friendly name for this driver wrapper
    • catalogName

      public String catalogName()
      Description copied from interface: IDriverWrapper
      What should the UI use to describe a catalog?
      Specified by:
      catalogName in interface IDriverWrapper
    • defaultUrl

      public String defaultUrl()
      Description copied from interface: IDriverWrapper
      What should the default URL for this driver be?
      Specified by:
      defaultUrl in interface IDriverWrapper
    • driverClass

      public String driverClass()
      Description copied from interface: IDriverWrapper
      The class used by JDBC for this driver.
      Specified by:
      driverClass in interface IDriverWrapper
      Returns:
      the name of the class to load for this driver
    • isValidUrl

      public boolean isValidUrl(String url)
      Description copied from interface: IDriverWrapper
      Check if this is a valid URL for this driver.
      Specified by:
      isValidUrl in interface IDriverWrapper
    • hasScrollableCursors

      public boolean hasScrollableCursors()
      Description copied from interface: IDriverWrapper
      Return if the driver supports scrollable cursors
      Specified by:
      hasScrollableCursors in interface IDriverWrapper
      Returns:
    • getCatalogNames

      public String[] getCatalogNames(Connection connection) throws SQLException
      Description copied from interface: IDriverWrapper
      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.
      Specified by:
      getCatalogNames in interface IDriverWrapper
      Parameters:
      connection - the JDBC connection
      Returns:
      an array of catalog names
      Throws:
      SQLException - when the underlying SQL operation fails
    • getTableNames

      public String[] getTableNames(Connection connection, String catalogName) throws SQLException
      Description copied from interface: IDriverWrapper
      Get the list of tables within a catalog.
      Specified by:
      getTableNames in interface IDriverWrapper
      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
    • getServerTimeZone

      public TimeZone getServerTimeZone(Connection connection) throws SQLException
      Description copied from interface: IDriverWrapper
      Return server time zone (for interpreting datetime values)
      Specified by:
      getServerTimeZone in interface IDriverWrapper
      Throws:
      SQLException
    • quoteEscapeTableName

      public String quoteEscapeTableName(String schemaName, String tableName)
      Quote and escape a schema and table name in accordance with PostgreSQL, for use in a query. This quotes the given table name with double-quotes and doubles embedded double-quotes.
      Specified by:
      quoteEscapeTableName in interface IDriverWrapper
      Parameters:
      schemaName - the raw unquoted, unescaped schema name
      tableName - the raw unquoted, unescaped table name
      Returns:
      the quoted, escaped table name
    • quoteEscapeColumnName

      public String quoteEscapeColumnName(String columnName)
      Quote and escape a column name in accordance with PostgreSQL, for use in a query. This quotes the given column name with double-quotes and doubles embedded double-quotes.
      Specified by:
      quoteEscapeColumnName in interface IDriverWrapper
      Parameters:
      columnName - the raw unquoted, unescaped column name
      Returns:
      the quoted, escaped column name