Class PostgresDriverWrapper

java.lang.Object
io.deephaven.importers.jdbc.util.PostgresDriverWrapper
All Implemented Interfaces:
IDriverWrapper

public class PostgresDriverWrapper extends Object implements IDriverWrapper
JDBC driver wrapper for PostgreSQL.
  • Field Details

  • Constructor Details

    • PostgresDriverWrapper

      public PostgresDriverWrapper(Logger log)
      Parameters:
      log - for logging
  • Method Details

    • friendlyName

      public String friendlyName()
      Description copied from interface: IDriverWrapper
      Get the user-friendly name. For example "Mysql", "Oracle", "MS SQL Server" can be displayed to the user.
      Specified by:
      friendlyName in interface IDriverWrapper
      Returns:
      a friendly name for this driver wrapper
    • catalogName

      public String catalogName()
      Description copied from interface: IDriverWrapper
      Define what the UI should use to describe a catalog.
      Specified by:
      catalogName in interface IDriverWrapper
      Returns:
      the name of the catalog type (e.g.,"SQL Database", "Database")
    • defaultUrl

      public String defaultUrl()
      Description copied from interface: IDriverWrapper
      Define the default URL for this driver.
      Specified by:
      defaultUrl in interface IDriverWrapper
      Returns:
      the default URL
    • 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
      Parameters:
      url - the uri
      Returns:
      true if valid
    • hasScrollableCursors

      public boolean hasScrollableCursors()
      Description copied from interface: IDriverWrapper
      Return if the driver supports scrollable cursors.
      Specified by:
      hasScrollableCursors in interface IDriverWrapper
      Returns:
      true if scrollable cursors are supported
    • 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 the server time zone for interpreting datetime values.
      Specified by:
      getServerTimeZone in interface IDriverWrapper
      Parameters:
      connection - the JDBC connection
      Returns:
      the server time zone
      Throws:
      SQLException - when the underlying SQL operation fails
    • 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