Package io.deephaven.importers.jdbc.util
Class PostgresDriverWrapper
java.lang.Object
io.deephaven.importers.jdbc.util.PostgresDriverWrapper
- All Implemented Interfaces:
IDriverWrapper
JDBC driver wrapper for PostgreSQL.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.importers.jdbc.util.IDriverWrapper
IDriverWrapper.DisplayInfo, IDriverWrapper.Factory -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDefine what the UI should use to describe a catalog.Define the default URL for this driver.The class used by JDBC for this driver.Get the user-friendly name.String[]getCatalogNames(Connection connection) Get the list of Catalogs.getServerTimeZone(Connection connection) Return the server time zone for interpreting datetime values.String[]getTableNames(Connection connection, String catalogName) Get the list of tables within a catalog.booleanReturn if the driver supports scrollable cursors.booleanisValidUrl(String url) Check if this is a valid URL for this driver.quoteEscapeColumnName(String columnName) Quote and escape a column name in accordance with PostgreSQL, for use in a query.quoteEscapeTableName(String schemaName, String tableName) Quote and escape a schema and table name in accordance with PostgreSQL, for use in a query.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.importers.jdbc.util.IDriverWrapper
displayInfo, load
-
Field Details
-
FRIENDLY_NAME
- See Also:
-
CATALOG_NAME
- See Also:
-
DEFAULT_URL
- See Also:
-
DRIVER_CLASS
- See Also:
-
-
Constructor Details
-
PostgresDriverWrapper
- Parameters:
log- for logging
-
-
Method Details
-
friendlyName
Description copied from interface:IDriverWrapperGet the user-friendly name. For example "Mysql", "Oracle", "MS SQL Server" can be displayed to the user.- Specified by:
friendlyNamein interfaceIDriverWrapper- Returns:
- a friendly name for this driver wrapper
-
catalogName
Description copied from interface:IDriverWrapperDefine what the UI should use to describe a catalog.- Specified by:
catalogNamein interfaceIDriverWrapper- Returns:
- the name of the catalog type (e.g.,"SQL Database", "Database")
-
defaultUrl
Description copied from interface:IDriverWrapperDefine the default URL for this driver.- Specified by:
defaultUrlin interfaceIDriverWrapper- Returns:
- the default URL
-
driverClass
Description copied from interface:IDriverWrapperThe class used by JDBC for this driver.- Specified by:
driverClassin interfaceIDriverWrapper- Returns:
- the name of the class to load for this driver
-
isValidUrl
Description copied from interface:IDriverWrapperCheck if this is a valid URL for this driver.- Specified by:
isValidUrlin interfaceIDriverWrapper- Parameters:
url- the uri- Returns:
- true if valid
-
hasScrollableCursors
public boolean hasScrollableCursors()Description copied from interface:IDriverWrapperReturn if the driver supports scrollable cursors.- Specified by:
hasScrollableCursorsin interfaceIDriverWrapper- Returns:
- true if scrollable cursors are supported
-
getCatalogNames
Description copied from interface:IDriverWrapperGet 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:
getCatalogNamesin interfaceIDriverWrapper- Parameters:
connection- the JDBC connection- Returns:
- an array of catalog names
- Throws:
SQLException- when the underlying SQL operation fails
-
getTableNames
Description copied from interface:IDriverWrapperGet the list of tables within a catalog.- Specified by:
getTableNamesin interfaceIDriverWrapper- Parameters:
connection- the JDBC connectioncatalogName- the catalog to get names for- Returns:
- an array of table names
- Throws:
SQLException- when the underlying SQL operation fails
-
getServerTimeZone
Description copied from interface:IDriverWrapperReturn the server time zone for interpreting datetime values.- Specified by:
getServerTimeZonein interfaceIDriverWrapper- Parameters:
connection- the JDBC connection- Returns:
- the server time zone
- Throws:
SQLException- when the underlying SQL operation fails
-
quoteEscapeTableName
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:
quoteEscapeTableNamein interfaceIDriverWrapper- Parameters:
schemaName- the raw unquoted, unescaped schema nametableName- the raw unquoted, unescaped table name- Returns:
- the quoted, escaped table name
-
quoteEscapeColumnName
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:
quoteEscapeColumnNamein interfaceIDriverWrapper- Parameters:
columnName- the raw unquoted, unescaped column name- Returns:
- the quoted, escaped column name
-