public class MetadataServerAPIHelper extends MetadataAPIHelper
MetadataAPIHelper.enumFunc<T extends Enum<T>>, MetadataAPIHelper.GetCatalogs_Metadata, MetadataAPIHelper.GetColumns_Metadata, MetadataAPIHelper.GetSchemas_Metadata, MetadataAPIHelper.GetTables_Metadataconnection, GET_CATALOGS_COLS, GET_COLUMNS_COLS, GET_SCHEMAS_COLS, GET_TABLES_COLS, prepare_QUOTE_IDENT, prepare_QUOTE_LITERAL, QUOTE_IDENT_parameter_index, QUOTE_IDENT_result_col_index, QUOTE_LITERAL_parameter_index, QUOTE_LITERAL_result_col_index, SHOW_COLUMNS_CHARACTER_MAXIMUM_LENGTH, SHOW_COLUMNS_COLUMN_DEFAULT, SHOW_COLUMNS_COLUMN_NAME, SHOW_COLUMNS_DATA_TYPE, SHOW_COLUMNS_DATABASE_NAME, 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_TABLE_NAME, SHOW_DATABASES_DATABASE_NAME, SHOW_SCHEMAS_DATABASE_NAME, SHOW_SCHEMAS_SCHEMA_NAME, SHOW_TABLES_DATABASE_NAME, SHOW_TABLES_REMARKS, SHOW_TABLES_SCHEMA_NAME, SHOW_TABLES_TABLE_NAME, SHOW_TABLES_TABLE_TYPE, SQL_PREP_SHOWCOLUMNS, SQL_PREP_SHOWDATABASES, SQL_PREP_SHOWDATABASESLIKE, SQL_PREP_SHOWSCHEMAS, SQL_PREP_SHOWSCHEMASLIKE, SQL_PREP_SHOWTABLES, SQL_SHOWCOLUMNS, SQL_SHOWCOLUMNSLIKE, SQL_SHOWDATABASES, SQL_SHOWDATABASESLIKE, SQL_SHOWSCHEMAS, SQL_SHOWSCHEMASLIKE, SQL_SHOWTABLES, SQL_SHOWTABLESLIKE| Constructor and Description |
|---|
MetadataServerAPIHelper(RedshiftConnectionImpl connection) |
| Modifier and Type | Method and Description |
|---|---|
protected List<String> |
callGetCatalogList(String catalog,
boolean isSingleDatabaseMetaData)
Helper function to get a list of catalog name
|
protected String |
callQuoteIdent(String input)
Helper function to call QUOTE_IDENT and return result as string
|
protected String |
callQuoteLiteral(String input)
Helper function to call QUOTE_LITERAL and return result as string
|
protected ResultSet |
callShowColumns(String catalog,
String schema,
String table,
String column)
Helper function to determine whether calling SHOW COLUMNS with LIKE or not
|
protected ResultSet |
callShowColumnsWithLike(String catalog,
String schema,
String table,
String column)
Helper function to call SHOW COLUMNS with LIKE
|
protected ResultSet |
callShowColumnsWithOUTLike(String catalog,
String schema,
String table)
Helper function to call SHOW COLUMNS
|
protected ResultSet |
callShowSchemas(String catalog,
String schema)
Helper function to determine whether calling SHOW SCHEMAS with LIKE or not
|
protected ResultSet |
callShowSchemasWithLike(String catalog,
String schema)
Helper function to call SHOW SCHEMAS with LIKE
|
protected ResultSet |
callShowSchemasWithOUTLike(String catalog)
Helper function to call SHOW SCHEMAS
|
protected ResultSet |
callShowTables(String catalog,
String schema,
String table)
Helper function to determine whether calling SHOW TABLES with LIKE or not
|
protected ResultSet |
callShowTablesWithLike(String catalog,
String schema,
String table)
Helper function to call SHOW TABLES with LIKE
|
protected ResultSet |
callShowTablesWithOUTLike(String catalog,
String schema)
Helper function to call SHOW TABLES
|
protected List<String> |
getCatalogList(boolean isSingleDatabaseMetaData)
Helper function to retrieve a list of catalog name from SHOW DATABASES
|
protected ResultSet |
getCatalogsServerAPI()
Returns a Result set for SHOW DATABASES
|
protected List<ResultSet> |
getColumnsServerAPI(String catalog,
String schemaPattern,
String tableNamePattern,
String columnNamePattern,
boolean retEmpty,
boolean isSingleDatabaseMetaData)
Returns a list of intermediate result set for SHOW COLUMNS
|
protected List<ResultSet> |
getSchemasServerAPI(String catalog,
String schemaPattern,
boolean retEmpty,
boolean isSingleDatabaseMetaData)
Returns a list of intermediate result set for SHOW SCHEMAS
|
protected List<ResultSet> |
getTablesServerAPI(String catalog,
String schemaPattern,
String tableNamePattern,
boolean retEmpty,
boolean isSingleDatabaseMetaData)
Returns a list of intermediate result set for SHOW TABLES
|
createEmptyRs, createMetaDataPreparedStatement, createMetaDataStatement, createNullRs, createRs, encodeStr, getAutoIncrement, getColumnSize, getDecimalDigit, getEmptyTuple, getEmptyTupleList, getField, getNullable, getNullTuple, getNullTupleList, getNumPrefixRadix, getRSType, getSQLType, runQuerypublic MetadataServerAPIHelper(RedshiftConnectionImpl connection) throws SQLException
SQLExceptionprotected ResultSet getCatalogsServerAPI() throws SQLException
SQLExceptionprotected List<ResultSet> getSchemasServerAPI(String catalog, String schemaPattern, boolean retEmpty, 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 searchretEmpty - boolean to determine if we want to directly return empty result without calling any SHOW commandisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLExceptionprotected List<ResultSet> getTablesServerAPI(String catalog, String schemaPattern, String tableNamePattern, boolean retEmpty, 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 databaseretEmpty - boolean to determine if we want to directly return empty result without calling any SHOW commandisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLExceptionprotected List<ResultSet> getColumnsServerAPI(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern, boolean retEmpty, 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 databaseretEmpty - boolean to determine if we want to directly return empty result without calling any SHOW commandisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLExceptionprotected List<String> callGetCatalogList(String catalog, 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 searchisSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLExceptionprotected List<String> getCatalogList(boolean isSingleDatabaseMetaData) throws SQLException
isSingleDatabaseMetaData - boolean to determine if we want to retrieve metadata information only from current connected databaseSQLExceptionprotected ResultSet callShowSchemas(String catalog, String schema) throws SQLException
catalog - a catalog name (can't be null)schema - 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 searchSQLExceptionprotected ResultSet callShowSchemasWithOUTLike(String catalog) throws SQLException
catalog - a catalog name (can't be null)SQLExceptionprotected ResultSet callShowSchemasWithLike(String catalog, String schema) throws SQLException
catalog - a catalog name (can't be null)schema - a schema name pattern (can't be null)SQLExceptionprotected ResultSet callShowTables(String catalog, String schema, String table) throws SQLException
catalog - a catalog name (can't be null)schema - a schema name (can't be null or pattern)table - a table name pattern; must match the table name as it is stored in the databaseSQLExceptionprotected ResultSet callShowTablesWithOUTLike(String catalog, String schema) throws SQLException
catalog - a catalog name (can't be null)schema - a schema name (can't be null or pattern)SQLExceptionprotected ResultSet callShowTablesWithLike(String catalog, String schema, String table) throws SQLException
catalog - a catalog name (can't be null)schema - a schema name (can't be null or pattern)table - a table name pattern (can't be null)SQLExceptionprotected ResultSet callShowColumns(String catalog, String schema, String table, String column) throws SQLException
catalog - a catalog name (can't be null)schema - a schema name (can't be null or pattern)table - a table name (can't be null or pattern)column - a column name pattern; must match the column name as it is stored in the databaseSQLExceptionprotected ResultSet callShowColumnsWithOUTLike(String catalog, String schema, String table) throws SQLException
catalog - a catalog name (can't be null)schema - a schema name (can't be null or pattern)table - a table name (can't be null or pattern)SQLExceptionprotected ResultSet callShowColumnsWithLike(String catalog, String schema, String table, String column) throws SQLException
catalog - a catalog name (can't be null)schema - a schema name (can't be null or pattern)table - a table name pattern (can't be null or pattern)column - a column name pattern (can't be null)SQLExceptionprotected String callQuoteLiteral(String input) throws SQLException
input - the input string we want to parse into QUOTE_LITERALSQLExceptionprotected String callQuoteIdent(String input) throws SQLException
input - the input string we want to parse into QUOTE_IDENTSQLExceptionCopyright © 2024 Amazon.com Inc.. All rights reserved.