public class MetadataServerProxy extends MetadataAPIHelper
MetadataAPIHelper.BestRowIdenData, MetadataAPIHelper.enumFunc<T extends Enum<T>>, MetadataAPIHelper.ForeignKeyColumnIndex, MetadataAPIHelper.GetBestRowIdentifier_Metadata, MetadataAPIHelper.GetCatalogs_Metadata, MetadataAPIHelper.GetColumnPrivileges_Metadata, MetadataAPIHelper.GetColumns_Metadata, MetadataAPIHelper.GetForeignKeys_Metadata, MetadataAPIHelper.GetFunctions_Metadata, MetadataAPIHelper.GetFunctionsColumns_Metadata, MetadataAPIHelper.GetPrimaryKeys_Metadata, MetadataAPIHelper.GetProcedures_Metadata, MetadataAPIHelper.GetProceduresColumns_Metadata, MetadataAPIHelper.GetSchemas_Metadata, MetadataAPIHelper.GetTablePrivileges_Metadata, MetadataAPIHelper.GetTables_Metadata, MetadataAPIHelper.GetTableType_Metadata, MetadataAPIHelper.ProcedureFunctionColumnData, MetadataAPIHelper.RedshiftDataTypes, MetadataAPIHelper.ShowColumnsInfo, MetadataAPIHelper.ShowForeignKeysInfo, MetadataAPIHelper.ShowFunctionsInfo, MetadataAPIHelper.ShowGrantsInfo, MetadataAPIHelper.ShowParametersInfo, MetadataAPIHelper.ShowPrimaryKeysInfo, MetadataAPIHelper.ShowProceduresInfo, MetadataAPIHelper.ShowSchemasInfo, MetadataAPIHelper.ShowTablesInfoconnection, DATETIME_PRECISION_PATTERN, EMPTY_REMARKS, FUNCTION_COLUMN_TYPE_MAP, GET_BEST_ROW_IDENTIFIER_COLS, GET_CATALOGS_COLS, GET_COLUMN_PRIVILEGES_COLS, GET_COLUMNS_COLS, GET_FOREIGN_KEYS_COLS, GET_FUNCTIONS_COLS, GET_FUNCTIONS_COLUMNS_COLS, GET_PRIMARY_KEYS_COLS, GET_PROCEDURES_COLS, GET_PROCEDURES_COLUMNS_COLS, GET_SCHEMAS_COLS, GET_TABLE_PRIVILEGES_COLS, GET_TABLE_TYPE_COLS, GET_TABLES_COLS, IMPORTED_KEY_NO_ACTION, IMPORTED_KEY_NOT_DEFERRABLE, INTERVAL_PRECISION_PATTERN, IS_NULLABLE_VALUE, NULLABLE_UNKNOWN_VALUE, PRECISION_EXTRACTION_PATTERN, PRECISION_REMOVAL_PATTERN, PROCEDURE_COLUMN_TYPE_MAP, PSEUDO_COLUMN_VALUE, RADIX_VALUE, SHOW_COLUMNS_CHARACTER_MAXIMUM_LENGTH, SHOW_COLUMNS_COLLATION, SHOW_COLUMNS_COLUMN_DEFAULT, SHOW_COLUMNS_COLUMN_NAME, SHOW_COLUMNS_DATA_TYPE, SHOW_COLUMNS_DATABASE_NAME, SHOW_COLUMNS_DIST_KEY, SHOW_COLUMNS_ENCODING, SHOW_COLUMNS_IS_NULLABLE, SHOW_COLUMNS_NUMERIC_PRECISION, SHOW_COLUMNS_NUMERIC_SCALE, SHOW_COLUMNS_ORDINAL_POSITION, SHOW_COLUMNS_REMARKS, SHOW_COLUMNS_SCHEMA_NAME, SHOW_COLUMNS_SORT_KEY, SHOW_COLUMNS_SORT_KEY_TYPE, SHOW_COLUMNS_TABLE_NAME, SHOW_DATABASES_DATABASE_NAME, SHOW_FOREIGN_KEYS_DEFERRABILITY, SHOW_FOREIGN_KEYS_DELETE_RULE, SHOW_FOREIGN_KEYS_FK_COLUMN_NAME, SHOW_FOREIGN_KEYS_FK_DATABASE_NAME, SHOW_FOREIGN_KEYS_FK_NAME, SHOW_FOREIGN_KEYS_FK_SCHEMA_NAME, SHOW_FOREIGN_KEYS_FK_TABLE_NAME, SHOW_FOREIGN_KEYS_KEY_SEQ, SHOW_FOREIGN_KEYS_PK_COLUMN_NAME, SHOW_FOREIGN_KEYS_PK_DATABASE_NAME, SHOW_FOREIGN_KEYS_PK_NAME, SHOW_FOREIGN_KEYS_PK_SCHEMA_NAME, SHOW_FOREIGN_KEYS_PK_TABLE_NAME, SHOW_FOREIGN_KEYS_UPDATE_RULE, SHOW_FUNCTIONS_ARGUMENT_LIST, SHOW_FUNCTIONS_DATABASE_NAME, SHOW_FUNCTIONS_FUNCTION_NAME, SHOW_FUNCTIONS_RETURN_TYPE, SHOW_FUNCTIONS_SCHEMA_NAME, SHOW_GRANT_ADMIN_OPTION, SHOW_GRANT_COLUMN_NAME, SHOW_GRANT_DATABASE_NAME, SHOW_GRANT_GRANTOR, SHOW_GRANT_IDENTITY_NAME, SHOW_GRANT_OBJECT_NAME, SHOW_GRANT_PRIVILEGE_TYPE, SHOW_GRANT_SCHEMA_NAME, SHOW_GRANT_TABLE_NAME, SHOW_PARAMETERS_CHARACTER_MAXIMUM_LENGTH, SHOW_PARAMETERS_DATA_TYPE, SHOW_PARAMETERS_DATABASE_NAME, SHOW_PARAMETERS_FUNCTION_NAME, SHOW_PARAMETERS_NUMERIC_PRECISION, SHOW_PARAMETERS_NUMERIC_SCALE, SHOW_PARAMETERS_ORDINAL_POSITION, SHOW_PARAMETERS_PARAMETER_NAME, SHOW_PARAMETERS_PARAMETER_TYPE, SHOW_PARAMETERS_PROCEDURE_NAME, SHOW_PARAMETERS_SCHEMA_NAME, SHOW_PRIMARY_KEYS_COLUMN_NAME, SHOW_PRIMARY_KEYS_DATABASE_NAME, SHOW_PRIMARY_KEYS_KEY_SEQ, SHOW_PRIMARY_KEYS_PK_NAME, SHOW_PRIMARY_KEYS_SCHEMA_NAME, SHOW_PRIMARY_KEYS_TABLE_NAME, SHOW_PROCEDURES_ARGUMENT_LIST, SHOW_PROCEDURES_DATABASE_NAME, SHOW_PROCEDURES_PROCEDURE_NAME, SHOW_PROCEDURES_RETURN_TYPE, SHOW_PROCEDURES_SCHEMA_NAME, SHOW_SCHEMAS_DATABASE_NAME, SHOW_SCHEMAS_SCHEMA_NAME, SHOW_TABLES_DATABASE_NAME, SHOW_TABLES_DIST_STYLE, SHOW_TABLES_LAST_ALTERED_TIME, SHOW_TABLES_LAST_MODIFIED_TIME, SHOW_TABLES_OWNER, SHOW_TABLES_REMARKS, SHOW_TABLES_SCHEMA_NAME, SHOW_TABLES_TABLE_NAME, SHOW_TABLES_TABLE_SUBTYPE, SHOW_TABLES_TABLE_TYPE, SQL_LIKE, SQL_PREP_SHOWCOLUMNS, SQL_PREP_SHOWCOLUMNSLIKE, SQL_PREP_SHOWDATABASES, SQL_PREP_SHOWFOREIGNEXPORTEDKEYS, SQL_PREP_SHOWFOREIGNKEYS, SQL_PREP_SHOWFUNCTIONS, SQL_PREP_SHOWFUNCTIONSLIKE, SQL_PREP_SHOWGRANTSCOLUMN, SQL_PREP_SHOWGRANTSCOLUMNLIKE, SQL_PREP_SHOWGRANTSTABLE, SQL_PREP_SHOWPARAMETERSFUNCTION, SQL_PREP_SHOWPARAMETERSPROCEDURE, SQL_PREP_SHOWPRIMARYKEYS, SQL_PREP_SHOWPROCEDURES, SQL_PREP_SHOWPROCEDURESLIKE, SQL_PREP_SHOWSCHEMAS, SQL_PREP_SHOWSCHEMASLIKE, SQL_PREP_SHOWTABLES, SQL_PREP_SHOWTABLESLIKE, SQL_SEMICOLON, TRAILING_SPACES_PATTERN| Constructor and Description |
|---|
MetadataServerProxy(RedshiftConnectionImpl connection) |
| Modifier and Type | Method and Description |
|---|---|
protected List<MetadataAPIHelper.ShowColumnsInfo> |
callShowColumns(String catalog,
String schema,
String table,
String columnNamePattern)
Helper function to get a ResultSet for SHOW COLUMNS
|
protected List<MetadataAPIHelper.ShowForeignKeysInfo> |
callShowConstraintsForeignKey(String catalog,
String schema,
String table,
String sql)
Helper function to get a ResultSet for Show Constraint Foreign Key
|
protected List<MetadataAPIHelper.ShowPrimaryKeysInfo> |
callShowConstraintsPrimaryKey(String catalog,
String schema,
String table)
Helper function to get a ResultSet of Show Constraint Primary Key
|
protected List<MetadataAPIHelper.ShowFunctionsInfo> |
callShowFunctions(String catalog,
String schema,
String functionNamePattern,
boolean fullResult)
Helper function to get a ResultSet for SHOW FUNCTIONS
|
protected List<MetadataAPIHelper.ShowProceduresInfo> |
callShowProcedures(String catalog,
String schema,
String procedureNamePattern,
boolean fullResult)
Helper function to get a ResultSet for SHOW PROCEDURES
|
protected List<MetadataAPIHelper.ShowSchemasInfo> |
callShowSchemas(String catalog,
String schemaPattern,
boolean fullResult)
Helper function to get a ResultSet for SHOW SCHEMAS
|
protected List<MetadataAPIHelper.ShowTablesInfo> |
callShowTables(String catalog,
String schema,
String tableNamePattern,
boolean fullResult)
Helper function to get a ResultSet for SHOW TABLES
|
protected List<String> |
fetchCatalogNames(String catalog,
boolean isSingleDatabaseMetaData)
Retrieves a list of database/catalog names.
|
List<MetadataAPIHelper.BestRowIdenData> |
getBestRowIdentifier(String catalog,
String schema,
String table,
boolean isSingleDatabaseMetaData)
Returns a list of intermediate result set for Best Row Identifier
|
protected List<String> |
getCatalogs()
Returns a Result set for SHOW DATABASES
|
List<MetadataAPIHelper.ShowGrantsInfo> |
getColumnPrivileges(String catalog,
String schema,
String table,
String columnNamePattern,
boolean isSingleDatabaseMetaData)
Returns a list of intermediate result set for SHOW GRANTS ON COLUMN
|
protected List<MetadataAPIHelper.ShowColumnsInfo> |
getColumns(String catalog,
String schemaPattern,
String tableNamePattern,
String columnNamePattern,
boolean isSingleDatabaseMetaData)
Returns a list of intermediate result set for SHOW COLUMNS
|
protected List<MetadataAPIHelper.ShowForeignKeysInfo> |
getForeignKeys(String catalog,
String schema,
String table,
boolean isSingleDatabaseMetaData,
boolean isImported)
Returns a list of intermediate result set for SHOW CONSTRAINTS FOREIGN KEY
|
protected List<MetadataAPIHelper.ProcedureFunctionColumnData> |
getFunctionColumns(String catalog,
String schemaPattern,
String functionNamePattern,
String columnNamePattern,
boolean isSingleDatabaseMetaData)
Returns a list of intermediate result set for SHOW COLUMNS FROM FUNCTION
|
protected List<MetadataAPIHelper.ShowFunctionsInfo> |
getFunctions(String catalog,
String schemaPattern,
String functionNamePattern,
boolean isSingleDatabaseMetaData)
Returns a list of intermediate result set for SHOW FUNCTIONS
|
protected List<MetadataAPIHelper.ShowPrimaryKeysInfo> |
getPrimaryKeys(String catalog,
String schema,
String table,
boolean isSingleDatabaseMetaData)
Returns a list of intermediate result set for SHOW CONSTRAINTS PRIMARY KEY
|
protected List<MetadataAPIHelper.ProcedureFunctionColumnData> |
getProcedureColumns(String catalog,
String schemaPattern,
String procedureNamePattern,
String columnNamePattern,
boolean isSingleDatabaseMetaData)
Returns a list of intermediate result set for SHOW COLUMNS FROM PROCEDURE
|
List<MetadataAPIHelper.ShowProceduresInfo> |
getProcedures(String catalog,
String schemaPattern,
String procedureNamePattern,
boolean isSingleDatabaseMetaData)
Returns a list of intermediate result set for SHOW PROCEDURES
|
protected List<MetadataAPIHelper.ShowSchemasInfo> |
getSchemas(String catalog,
String schemaPattern,
boolean isSingleDatabaseMetaData)
Returns a list of intermediate result set for SHOW SCHEMAS
|
List<MetadataAPIHelper.ShowGrantsInfo> |
getTablePrivileges(String catalog,
String schemaPattern,
String tableNamePattern,
boolean isSingleDatabaseMetaData)
Returns a list of intermediate result set for SHOW GRANTS ON TABLE
|
protected List<MetadataAPIHelper.ShowTablesInfo> |
getTables(String catalog,
String schemaPattern,
String tableNamePattern,
boolean isSingleDatabaseMetaData)
Returns a list of intermediate result set for SHOW TABLES
|
convertSqlLikeToRegex, createMetaDataPreparedStatement, createMetaDataStatement, createParameterizedQueryString, createRs, encodeStr, getAutoIncrement, getColumnLength, getColumnSize, getDecimalDigit, getEmptyTuple, getField, getFunctionColumnType, getFunctionType, getIsGrantable, getNullable, getNumPrefixRadix, getProcedureColumnType, getProcedureType, getRSType, getSpecificName, getSQLType, patternMatch, runQuery, sortForeignKeyTuplespublic MetadataServerProxy(RedshiftConnectionImpl connection) throws SQLException
SQLExceptionprotected List<String> getCatalogs() throws SQLException
SQLException - if a database error occursprotected List<MetadataAPIHelper.ShowSchemasInfo> getSchemas(String catalog, String schemaPattern, boolean isSingleDatabaseMetaData) throws SQLException
catalog - a catalog name; must match the catalog name as it is stored in the database; null means that the catalog name should not be used to narrow the searchschemaPattern - a schema pattern; must match the schema name as it is stored in the database; null means that the schema name should not be used to narrow the searchisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLException - if a database error occursprotected List<MetadataAPIHelper.ShowTablesInfo> getTables(String catalog, String schemaPattern, String tableNamePattern, boolean isSingleDatabaseMetaData) throws SQLException
catalog - a catalog name; must match the catalog name as it is stored in the database; null means that the catalog name should not be used to narrow the searchschemaPattern - a schema name pattern; must match the schema name as it is stored in the database; null means that the schema name should not be used to narrow the searchtableNamePattern - a table name pattern; must match the table name as it is stored in the databaseisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLException - if a database error occursprotected List<MetadataAPIHelper.ShowColumnsInfo> getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern, boolean isSingleDatabaseMetaData) throws SQLException
catalog - a catalog name; must match the catalog name as it is stored in the database; null means that the catalog name should not be used to narrow the searchschemaPattern - a schema name pattern; must match the schema name as it is stored in the database; null means that the schema name should not be used to narrow the searchtableNamePattern - a table name pattern; must match the table name as it is stored in the databasecolumnNamePattern - a column name pattern; must match the column name as it is stored in the databaseisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLException - if a database error occursprotected List<MetadataAPIHelper.ShowPrimaryKeysInfo> getPrimaryKeys(String catalog, String schema, String table, boolean isSingleDatabaseMetaData) throws SQLException
catalog - a catalog name; must match the catalog name as it is stored in the database; null means that the catalog name should not be used to narrow the searchschema - a schema name; must match the schema name as it is stored in the database; null means that the schema name should not be used to narrow the searchtable - a table name; must match the table name as it is stored in the databaseisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLException - if a database error occursprotected List<MetadataAPIHelper.ShowForeignKeysInfo> getForeignKeys(String catalog, String schema, String table, boolean isSingleDatabaseMetaData, boolean isImported) throws SQLException
catalog - a catalog name; must match the catalog name as it is stored in the database; null means that the catalog name should not be used to narrow the searchschema - a schema name; must match the schema name as it is stored in the database; null means that the schema name should not be used to narrow the searchtable - a table name; must match the table name as it is stored in the databaseisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseisImported - boolean to determine if we want to retrieve imported keys or exported keysSQLException - if a database error occurspublic List<MetadataAPIHelper.BestRowIdenData> getBestRowIdentifier(String catalog, String schema, String table, boolean isSingleDatabaseMetaData) throws SQLException
catalog - a catalog name; must match the catalog name as it is stored in the database; null means that the catalog name should not be used to narrow the searchschema - a schema name; must match the schema name as it is stored in the database; null means that the schema name should not be used to narrow the searchtable - a table name; must match the table name as it is stored in the databaseisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLException - if a database error occurspublic List<MetadataAPIHelper.ShowGrantsInfo> getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern, boolean isSingleDatabaseMetaData) throws SQLException
catalog - a catalog name; must match the catalog name as it is stored in the database; null means that the catalog name should not be used to narrow the searchschema - a schema name; must match the schema name as it is stored in the database; null means that the schema name should not be used to narrow the searchtable - a table name; must match the table name as it is stored in the databasecolumnNamePattern - a column name pattern; must match the column name as it is stored in the databaseisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLException - if a database error occurspublic List<MetadataAPIHelper.ShowGrantsInfo> getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern, boolean isSingleDatabaseMetaData) throws SQLException
catalog - a catalog name; must match the catalog name as it is stored in the database; null means that the catalog name should not be used to narrow the searchschemaPattern - a schema name pattern; must match the schema name as it is stored in the database; null means that the schema name should not be used to narrow the searchtableNamePattern - a table name pattern; must match the table name as it is stored in the databaseisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLException - if a database error occurspublic List<MetadataAPIHelper.ShowProceduresInfo> getProcedures(String catalog, String schemaPattern, String procedureNamePattern, boolean isSingleDatabaseMetaData) throws SQLException
catalog - a catalog name; must match the catalog name as it is stored in the database; null means that the catalog name should not be used to narrow the searchschemaPattern - a schema name pattern; must match the schema name as it is stored in the database; null means that the schema name should not be used to narrow the searchprocedureNamePattern - a procedure name pattern; must match the procedure name as it is stored in the databaseisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLException - if a database error occursprotected List<MetadataAPIHelper.ProcedureFunctionColumnData> getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern, boolean isSingleDatabaseMetaData) throws SQLException
catalog - a catalog name; must match the catalog name as it is stored in the database; null means that the catalog name should not be used to narrow the searchschemaPattern - a schema name pattern; must match the schema name as it is stored in the database; null means that the schema name should not be used to narrow the searchprocedureNamePattern - a procedure name pattern; must match the procedure name as it is stored in the databasecolumnNamePattern - a column name pattern; must match the column name as it is stored in the databaseisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLException - if a database error occursprotected List<MetadataAPIHelper.ShowFunctionsInfo> getFunctions(String catalog, String schemaPattern, String functionNamePattern, boolean isSingleDatabaseMetaData) throws SQLException
catalog - a catalog name; must match the catalog name as it is stored in the database; null means that the catalog name should not be used to narrow the searchschemaPattern - a schema name pattern; must match the schema name as it is stored in the database; null means that the schema name should not be used to narrow the searchfunctionNamePattern - a function name pattern; must match the function name as it is stored in the databaseisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLException - if a database error occursprotected List<MetadataAPIHelper.ProcedureFunctionColumnData> getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern, boolean isSingleDatabaseMetaData) throws SQLException
catalog - a catalog name; must match the catalog name as it is stored in the database; null means that the catalog name should not be used to narrow the searchschemaPattern - a schema name pattern; must match the schema name as it is stored in the database; null means that the schema name should not be used to narrow the searchfunctionNamePattern - a function name pattern; must match the function name as it is stored in the databasecolumnNamePattern - a column name pattern; must match the column name as it is stored in the databaseisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLException - if a database error occursprotected List<String> fetchCatalogNames(String catalog, boolean isSingleDatabaseMetaData) throws SQLException
catalog - a catalog name; null means that the catalog name should not be used to narrow the searchisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLException - if a database error occursprotected List<MetadataAPIHelper.ShowSchemasInfo> callShowSchemas(String catalog, String schemaPattern, boolean fullResult) throws SQLException
catalog - The name of the catalogschemaPattern - The schema name patternfullResult - If true, returns full result for SHOW; if false, returns only schema namesSQLException - if a database error occursprotected List<MetadataAPIHelper.ShowTablesInfo> callShowTables(String catalog, String schema, String tableNamePattern, boolean fullResult) throws SQLException
catalog - The catalog nameschema - The schema nametableNamePattern - The table name patternfullResult - If true, returns full result for SHOW; if false, returns only table namesSQLException - if a database error occursprotected List<MetadataAPIHelper.ShowColumnsInfo> callShowColumns(String catalog, String schema, String table, String columnNamePattern) throws SQLException
catalog - The catalog nameschema - The schema nametable - The table namecolumnNamePattern - The column name patternSQLException - if a database error occursprotected List<MetadataAPIHelper.ShowPrimaryKeysInfo> callShowConstraintsPrimaryKey(String catalog, String schema, String table) throws SQLException
catalog - The catalog nameschema - The schema nametable - The table nameSQLException - if a database error occursprotected List<MetadataAPIHelper.ShowForeignKeysInfo> callShowConstraintsForeignKey(String catalog, String schema, String table, String sql) throws SQLException
catalog - The catalog nameschema - The schema nametable - The table namesql - the foreign key sql querySQLException - if a database error occursprotected List<MetadataAPIHelper.ShowProceduresInfo> callShowProcedures(String catalog, String schema, String procedureNamePattern, boolean fullResult) throws SQLException
catalog - The catalog nameschema - The schema nameprocedureNamePattern - The procedure name patternfullResult - If true, returns full result for SHOW; if false, returns only procedure names and argument listsSQLException - if a database error occursprotected List<MetadataAPIHelper.ShowFunctionsInfo> callShowFunctions(String catalog, String schema, String functionNamePattern, boolean fullResult) throws SQLException
catalog - The catalog nameschema - The schema namefunctionNamePattern - The function name patternfullResult - If true, returns full result for SHOW; if false, returns only function names and argument listsSQLException - if a database error occursCopyright © 2026 Amazon.com Inc.. All rights reserved.